Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File not found

Status
Not open for further replies.

angelz

Programmer
Joined
Apr 23, 2002
Messages
9
Location
GB
I have a problem here.
I tried ro read files in the web server, but I got the error message, File not found.
This is my coding,

(mainscript)
Dim serverfile
serverfile = "/angelz/path1/path2/iamfile.txt"

OpenNamedListFile(MainScriptObject.serverfile)

Sub OpenListFile(fileName)
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Dim item, i, exist
Set fso = CreateObject("Scripting.FileSystemObject")

On Error Resume Next
'Error handler in case the file does not exist
Set f = fso.GetFile(fileName)
if Err.Number <> 0 then
'File does not exist
MsgBox &quot;Error # &quot; & CStr(Err.Number) & &quot; &quot; & Err.Description & &quot; &quot; & filename & &quot;. Please inform the system administrator of the error.&quot;
Err.Clear ' Clear the error.
else
I got this error.
Can anyone help me? thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top