MapPath Problem

T

TheBob

I have read all related posts, but still cannot solve my issue.
With my database and asp page in the root folder all works fine.
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.open = Server.MapPath ("BillingQueSlim.mdb")
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT MEMBERID, MEMBER, ADDRESS, CITY, STATE, ZIP, BILLINGFREQUENCY
FROM Members WHERE MEMBERID = " & strName
'WHERE MEMBERID=" & strName
rs.Open sql, conn
%>

HOWEVER, for security I want the db in the fpdb folder with the asp
remaining in the root.

If I add the subfolder -- i.e., Server.MapPath ("fpdb/BillingQueSlim.mdb")
-- the page returns:
Microsoft JET Database Engine error '80004005'
Could not find file
'E:\kunden\homepages\31\d119399771\fpdb\billingqueslim.mdb'.
/fpatests/bheader.asp, line 16
I assume that is the physical path on the hosting server. I've tried a
leading slash, back slashes "..", etc. without success.

Can anyone spot the problem?
 
E

Evertjan.

=?Utf-8?B?VGhlQm9i?= wrote on 08 mrt 2005 in
microsoft.public.inetserver.asp.general:
I have read all related posts, but still cannot solve my issue.
With my database and asp page in the root folder all works fine.
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.open = Server.MapPath ("BillingQueSlim.mdb")
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT MEMBERID, MEMBER, ADDRESS, CITY, STATE, ZIP,
BILLINGFREQUENCY FROM Members WHERE MEMBERID = " & strName
'WHERE MEMBERID=" & strName
rs.Open sql, conn
%>

HOWEVER, for security I want the db in the fpdb folder with the asp
remaining in the root.

If I add the subfolder -- i.e., Server.MapPath
("fpdb/BillingQueSlim.mdb") -- the page returns:
Microsoft JET Database Engine error '80004005'
Could not find file
'E:\kunden\homepages\31\d119399771\fpdb\billingqueslim.mdb'.
/fpatests/bheader.asp, line 16
I assume that is the physical path on the hosting server. I've tried a
leading slash, back slashes "..", etc. without success.

Can anyone spot the problem?

It's all in debugging.

Why not first test the mappath result from the site root?

response.write Server.MapPath("/fpdb/BillingQueSlim.mdb")
response.end
 
S

Shahid Juma

Try doing it like this:

Server.MapPath ("../fpdb/BillingQueSlim.mdb")

Shahid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top