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
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
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!
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 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...
set objTStream = objFSO.OpenTextFile(fileName,1)
> 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
> 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