PDA

View Full Version : Path not found running ASP script


sash
10-28-2004, 08:59 AM
I am trying to run this ASP script


<%
Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject")
Set MyTextFile = MyFileObj.OpenTextFile("inetpub\wwwroot\intranet\quotes.txt")
IF NOT MyTextFile.AtEndOfStream THEN
header=CInt(MyTextFile.Readline)
END IF
RANDOMIZE
LowestNumber = 1
HighestNumber = header
RandomValue = INT((HighestNumber-LowestNumber+1)*Rnd+LowestNumber)
Count=0
WHILE NOT MyTextFile.AtEndOfStream AND NOT Count = RandomValue
quote = MyTextFile.Readline
Count=Count+1
WEND
MyTextFile.CLose
%>

but i keep getting this error:
Microsoft VBScript runtime error '800a004c' Path not found
It works fine on my local server, I have tried variations of the path name once I FTP the script to our main server and no matter what I keep getting this error. I dont know why as all my other scripts work fine.

Please can someone tell me where I am going wrong.

putts
10-28-2004, 09:58 AM
you need to provide the full path to your file (including the drive letter)

sash
10-28-2004, 10:07 AM
Thanks for the help, just as a matter of interest, why do I have to provide the driveletter when previously it has worked without it for other scripts?

Conor
10-31-2004, 11:19 AM
What is your connection string?

sash
11-01-2004, 03:51 AM
("inetpub\wwwroot\intranet\quotes.txt")
If i put the driveletter it works fine. For other scripts I dont need to do this