Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Microsoft VBScript runtime (0x800A004C)

93 views
Skip to first unread message

Dallas Stith

unread,
Jun 11, 2002, 2:18:00 PM6/11/02
to
Hello,

I am trying to figure out what is wrong here. When I try to run my
ASp acript I get the following error on my web browser:Error Type:


Microsoft VBScript runtime (0x800A004C)
Path not found
/test/test4/Includes/conn.asp, line 10

Here is my conn file


<%
'----------------- Include File For Defining The Connection String
--------------------

function getFileValue(fldName)
Dim objFSO,objTStream,fileName,arrLine
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'------- config.txt for Online and config1.txt for offline --------
fileName = Server.MapPath("test4\config.txt")
'response.write "FileName"&filename
set objTStream = objFSO.OpenTextFile(fileName,1)
do while not objTStream.AtEndofStream
arrLine = split(objTStream.ReadLine,"|")
if arrLine(0)= fldName then
getFileValue = arrLine(1)
end if
loop
end function

Dim file ,ResumeConn
file = getFileValue("DatabasePath")
ResumeConn = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & file &
";"
%>

Anybodys help would be greatly appreciated!!!!

Dallas S

Aaron Bertrand [MVP]

unread,
Jun 11, 2002, 2:40:09 PM6/11/02
to
> fileName = Server.MapPath("test4\config.txt")

Why is there a backslash here? Did you mean:

fileName = Server.MapPath("test4/config.txt")
or
fileName = Server.MapPath("/test4/config.txt")

--
www.aspfaq.com / www.perfhound.com


Dallas Stith

unread,
Jun 11, 2002, 3:25:18 PM6/11/02
to
Yes I did mean fileName = Server.MapPath("test4/config.txt")

Either way I get the same error.

Thanks for you help again

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dallas Stith

unread,
Jun 11, 2002, 3:29:22 PM6/11/02
to
Now I am getting this error after reloading the code:

Error Type:
Microsoft VBScript runtime (0x800A0035)
File not found
/test/test4/Includes/conn.asp, line 10

Here is the new conn file:

<%
'----------------- Include File For Defining The Connection String
--------------------

function getFileValue(fldName)
Dim objFSO,objTStream,fileName,arrLine
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'------- config.txt for Online and config1.txt for offline --------

fileName = Server.MapPath("../config1.txt")


'response.write "FileName"&filename
set objTStream = objFSO.OpenTextFile(fileName,1)
do while not objTStream.AtEndofStream
arrLine = split(objTStream.ReadLine,"|")
if arrLine(0)= fldName then
getFileValue = arrLine(1)
end if
loop
end function

Dim file ,ResumeConn
file = getFileValue("DatabasePath")
ResumeConn = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & file &
";"
%>

*** Sent via Developersdex http://www.developersdex.com ***

Curt_C

unread,
Jun 11, 2002, 3:40:26 PM6/11/02
to
which line is line 10?

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Bringing Your Data To The Web...
---------------------------------------------------------


"Dallas Stith" <dst...@bytesconsulting.com> wrote in message
news:uAA7K5XECHA.2712@tkmsftngp05...

Dallas Stith

unread,
Jun 11, 2002, 4:01:14 PM6/11/02
to
This is line 10


set objTStream = objFSO.OpenTextFile(fileName,1)

Aaron Bertrand [MVP]

unread,
Jun 11, 2002, 5:40:29 PM6/11/02
to
> /test/test4/Includes/conn.asp, line 10

> fileName = Server.MapPath("../config1.txt")

Given the path of your ASP file, try:

fileName = Server.MapPath("/test/test4/config1.txt")

--
www.aspfaq.com / www.perfhound.com


John Wood

unread,
Jun 12, 2002, 7:53:42 PM6/12/02
to
In article <uAA7K5XECHA.2712@tkmsftngp05>, Dallas Stith
<dst...@bytesconsulting.com> writes

>Now I am getting this error after reloading the code:
>
>Error Type:
>Microsoft VBScript runtime (0x800A0035)
>File not found
>/test/test4/Includes/conn.asp, line 10
>
The TXT file needs to be a level higher in the directory than the ASP
for this to work

> fileName = Server.MapPath("../config1.txt")

Where is the TXT file in relation to the ASP ?
fileName = Server.MapPath("config1.txt")
if in the same directory

you code works for me if the TXT file is above the ASP, and still works
with my amended code if the TXT file is in the same directory as the ASP

John Wood

0 new messages