Results 1 to 6 of 6

Thread: What is the FileSystemObject and ASPError Object of ASP

  1. #1
    Join Date
    Nov 2009

    What is the FileSystemObject and ASPError Object of ASP

    I have very recently started studying ASP(Active Server Pages). I have to work on a website which is built on ASP. This is the first time I am going to work on a website. I had earlier studied HTML(Hyper Text Markup Language) and Java, which is somewhat a bit helpful for me to understand very few concepts in ASP. But I am not able to understand the FileSystemObject and ASPError Object.

  2. #2
    Join Date
    May 2008

    ASPError Object

    For an ASP web page we can use the ASPError Object to get the detail description of the error that took place. It will put forward the scripting errors. This object of ASP was introduced in ASP 3.0. When the Server.GetLastError gets called then the ASPError object gets created. And hence the Server.GetLastError method is used to get the information on the error.

  3. #3
    Join Date
    Feb 2008

    ASP Object: FileSystemObject

    To access the file system which resides on a server the FileSystemObject object is used. To act upon the folder, directories paths and files the FileSystemObject is useful. Using this ASP Object we can gather file system information. Even I was confused when I started to learn the FileSystemObject in ASP.

  4. #4
    Join Date
    Apr 2008

    Creating an ASP text file

    Here is an example of how to create a Text file in Active Server Pages and then write some text to it. The file is stored at D:\temp.txt:
    dim files,filen
    set files=Server.CreateObject("Scripting.FileSystemObject")
    set filen=files.CreateTextFile("D:\temp.txt",true)
    filen.WriteLine("New Entry")
    set filen=nothing
    set files=nothing
    The above code writes text 'New Entry' to the temp.txt file.

  5. #5
    Join Date
    Jan 2008

    Properties of ASPError Object

    Following are the properties of the ASPError object:
    • Description: To get a short description of the error we use the Description property of the ASPError object.
    • ASPDescription: To get the detailed information of the occurred error we use the ASPDescription property of the ASPError object.
    • Number: To get the standard COM error of the error occurred we use the Number property of the ASPError object.
    • File: To get the name for the ASP file which actually generated the error we use the File property of the ASPError object.
    • ASPCode: The IIS generates an error code for an error, to get this error code we use the ASPCode property of the ASPError object.

  6. #6
    Join Date
    May 2008

    FileSystem object methods

    Here are a few methods of the ASP FileSystem object:
    • The BuildPath method: To add name to an already existing path, BuildPath method is used. The syntax for this is:
      In the above syntax the parameter name means the name which is to be added to the path and the parameter oath means the path to append a name to.
    • The CopyFile Method: To copy a file in ASP, the CopyFile method is used. The syntax is:
      FileSystemObject.CopyFile source,destination[,overwrite]
      In the above syntax, the parameter destination denotes the location where the file is to be copied, the parameter source denotes the file to be copied and the parameter overwrite is optional and denotes whether the existing file can be overwritten or not.

Similar Threads

  1. Replies: 3
    Last Post: 19-10-2011, 11:30 PM
  2. Replies: 6
    Last Post: 06-06-2011, 02:34 AM
  3. Replies: 3
    Last Post: 08-01-2011, 06:20 AM
  4. Explain the Global.asa file and ASPError Object in ASP
    By Juan-Carlos in forum Software Development
    Replies: 5
    Last Post: 22-12-2009, 06:12 AM
  5. ActiveX component can't create object: 'Scripting.FileSystemObject'
    By Fred Jacobowitz in forum Windows Server Help
    Replies: 9
    Last Post: 16-11-2005, 09:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts