Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is the FileSystemObject and ASPError Object of ASP

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 23-12-2009
Member
 
Join Date: Nov 2009
Posts: 63
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.

Reply With Quote
  #2  
Old 23-12-2009
Member
 
Join Date: May 2008
Posts: 2,006
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.
Reply With Quote
  #3  
Old 23-12-2009
Member
 
Join Date: Feb 2008
Posts: 1,845
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.
Reply With Quote
  #4  
Old 23-12-2009
Member
 
Join Date: Apr 2008
Posts: 1,999
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:
Code:
<%
dim files,filen
set files=Server.CreateObject("Scripting.FileSystemObject")
set filen=files.CreateTextFile("D:\temp.txt",true)
filen.WriteLine("New Entry")
filen.Close
set filen=nothing
set files=nothing
%>
The above code writes text 'New Entry' to the temp.txt file.
Reply With Quote
  #5  
Old 23-12-2009
Member
 
Join Date: Jan 2008
Posts: 1,514
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.
Reply With Quote
  #6  
Old 23-12-2009
Member
 
Join Date: May 2008
Posts: 2,290
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:
    Quote:
    [newpath=]FileSystemObject.BuildPath(path,name)
    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:
    Quote:
    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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is the FileSystemObject and ASPError Object of ASP"
Thread Thread Starter Forum Replies Last Post
ActiveX Component Can't Create Object Scripting.FileSystemObject Robla68 Windows Server Help 3 19-10-2011 10:30 PM
Getting HP AIO Device object server register class object failed message on my system Donoho Hardware Peripherals 6 06-06-2011 01:34 AM
Scope of Object or variable in Object oriented Programming Languages Dėfrim Software Development 3 08-01-2011 05:20 AM
Explain the Global.asa file and ASPError Object in ASP Juan-Carlos Software Development 5 22-12-2009 05:12 AM
ActiveX component can't create object: 'Scripting.FileSystemObject' Fred Jacobowitz Windows Server Help 9 16-11-2005 08:02 AM


All times are GMT +5.5. The time now is 09:17 AM.