Microsoft KB Archive/276011

= PRB: Error 800a0035 When You Use the FileSystemObject Object =

Article ID: 276011

Article Last Modified on 4/22/2003

-

APPLIES TO


 * Microsoft Active Server Pages 4.0

-



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



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.



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(&quot;Scripting.FileSystemObject&quot;) If objFSO.FileExists(Server.MapPath(&quot;filename.txt&quot;)) Then 'OK to access the file. Set objFile = objFSO.OpenTextFile(Server.MapPath(&quot;filename.txt&quot;),1) Else 'File not found. End If                     Use a fully qualified path and file name. For example: Set objFSO = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;) Set objFile = objFSO.OpenTextFile(&quot;c:\inetpub\wwwroot\filename.txt&quot;,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(&quot;Scripting.FileSystemObject&quot;) Set objFile = objFSO.OpenTextFile(Server.MapPath(&quot;filename.txt&quot;),1) 

