|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MapPath Problem
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? =?Utf-8?B?VGhlQm9i?= wrote on 08 mrt 2005 in
microsoft.public.inetserver.asp.general: Show quote > I have read all related posts, but still cannot solve my issue. It's all in debugging.> 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? 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) Try doing it like this:
Server.MapPath ("../fpdb/BillingQueSlim.mdb") Shahid Show quote "TheBob" <The***@discussions.microsoft.com> wrote in message news:C270E9C9-417E-48F5-8786-8275FF679DAE@microsoft.com... > 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? > >
http://www.powerasp.com/content/hintstips/physical-path.asp
Show quote "TheBob" <The***@discussions.microsoft.com> wrote in message
news:C270E9C9-417E-48F5-8786-8275FF679DAE@microsoft.com... >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? > > |
|||||||||||||||||||||||