MapPath Problem

Discussion in 'ASP General' started by TheBob, Mar 8, 2005.

  1. TheBob

    TheBob Guest

    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?
    TheBob, Mar 8, 2005
    #1
    1. Advertising

  2. TheBob

    Evertjan. Guest

    =?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


    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Mar 8, 2005
    #2
    1. Advertising

  3. TheBob

    Shahid Juma Guest

    Try doing it like this:

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

    Shahid

    "TheBob" <> wrote in message
    news:...
    > 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?
    >
    >
    Shahid Juma, Mar 8, 2005
    #3
  4. http://www.powerasp.com/content/hintstips/physical-path.asp

    "TheBob" <> wrote in message
    news:...
    >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?
    >
    >
    Kyle Peterson, Apr 30, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Berman

    Problem with MapPath and inheritance

    David Berman, Feb 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    395
    Craig Deelsnyder
    Feb 10, 2004
  2. Oberon

    Simple Server.MapPath problem?

    Oberon, May 11, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    569
    Ken Cox [Microsoft MVP]
    May 11, 2005
  3. Aahz
    Replies:
    0
    Views:
    493
  4. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,145
    Juan T. Llibre
    Mar 11, 2007
  5. Replies:
    4
    Views:
    966
    Juan T. Llibre
    Oct 7, 2007
Loading...

Share This Page