Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > MapPath Problem

Reply
Thread Tools

MapPath Problem

 
 
TheBob
Guest
Posts: n/a
 
      03-08-2005
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\billingque slim.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?


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      03-08-2005
=?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\billingque slim.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


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Reply With Quote
 
 
 
 
Shahid Juma
Guest
Posts: n/a
 
      03-08-2005
Try doing it like this:

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

Shahid

"TheBob" <> wrote in message
news:C270E9C9-417E-48F5-8786-...
> 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\billingque slim.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?
>
>



 
Reply With Quote
 
Kyle Peterson
Guest
Posts: n/a
 
      04-30-2005
http://www.powerasp.com/content/hint...sical-path.asp

"TheBob" <> wrote in message
news:C270E9C9-417E-48F5-8786-...
>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\billingque slim.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?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server.MapPath & Request.MapPath rn5a@rediffmail.com ASP .Net 4 10-07-2007 10:48 PM
server.mappath vs. request.mappath =?Utf-8?B?dHBhcmtzNjk=?= ASP .Net 2 03-11-2007 12:31 AM
Server.MapPath FileNotFound problem Aahz ASP .Net 0 08-09-2005 08:41 AM
Simple Server.MapPath problem? Oberon ASP .Net 2 05-11-2005 12:25 PM
Problem with MapPath and inheritance David Berman ASP .Net 1 02-10-2004 07:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57