Help and Support
 

powered byLive Search

PRB: Error 800a0035 When You Use the FileSystemObject Object

Article ID:276011
Last Review:April 22, 2003
Revision:1.1
This article was previously published under Q276011

SYMPTOMS

When you use the FileSystemObject object from an Active Server Pages (ASP) page, you may receive one of the following error messages:
Server object error 'ASP 0177 : 800a0035'
Server.CreateObject Failed
filename.asp, line xx
The operation completed successfully.
-or-
Microsoft VBScript runtime (0x800A0035)
File not found
filename.asp, line xx

Back to the top

CAUSE

This error occurs because FileSystemObject cannot find the file that is being accessed (through the OpenTextFile, DeleteFile, or CopyFile methods, for example). This typically occurs for two reasons:
The file does not exist.
FileSystemObject is not looking for the file in the folder that you had expected. By default, if you do not specify a path, FileSystemObject searches the WinNT\System32 folder.

Back to the top

RESOLUTION

You can work around this problem in a few different ways:
Verify that the file exists before you try to access it. For example:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath("filename.txt")) Then
     'OK to access the file.
     Set objFile = objFSO.OpenTextFile(Server.MapPath("filename.txt"),1) 
Else
     'File not found.
End If
					
Use a fully qualified path and file name. For example:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\inetpub\wwwroot\filename.txt",1)
					
Use the Server.MapPath method to map the virtual or relative path of the file to the full physical path of the file. For example:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(Server.MapPath("filename.txt"),1) 
					

Back to the top

REFERENCES

For additional information on the FileSystemObject object, click the article number below to view the article in the Microsoft Knowledge Base:
197964 (http://support.microsoft.com/kb/197964/EN-US/) PRB: Cannot Access Remote Files with the FileSystemObject

Back to the top


APPLIES TO
Microsoft Active Server Pages 4.0

Back to the top

Keywords: 
kberrmsg kbfso kbprb KB276011

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.