Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: MAPPATH


Message #1 by "Drew, Ron" <RDrew@B...> on Thu, 24 Jan 2002 13:55:11 -0500
This is a multi-part message in MIME format.



------_=_NextPart_001_01C1A508.A6A7D133

Content-Type: text/plain;

	charset="us-ascii"

Content-Transfer-Encoding: quoted-printable



One more question for you gurus out there....use of MapPath.  I have a

directory with the MDB on my site.  If I am executing an ASP within the

directory against the MDB I use this and it works fine......  Let say

the directory for my.mdb is  D:\InetPub\wwwroot\club\directory1\my.mdb

...so within this directory the asp works



mdbPath =3D Server.MapPath("my.mdb")

   set objConn =3D Server.CreateObject("ADODB.Connection")

   objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _

                     "Data Source=3D" & mdbPath & ";" & _

                     "User Id=3Dadmin;" & _

                     "Password=3D;"     



Problem is when I am in another directory on my website and try the

access the MDB using the MapPath lets say D:\InetPub\wwwroot\club2\...it

does not work.  I did a response.write on mdbPath and got

D:\InetPub\wwwroot\club2\my.mdb  could not be found.  How can I correct

the mdbPath setting using the Server.MapPath so that I can get at the DB

anywhere in the site without having to hardcode the Data Source for the

ASPs outside of the MDB directory???



  




Message #2 by <sathish297@y...> on Fri, 25 Jan 2002 10:37:09 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_0102_01C1A58C.3E201920

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



MessageHi Drew,



   You need not use MapPath when you know the full path to the db.



With Regards,

R. Sathish Kumar,

sathish297@y...



  ----- Original Message -----

  From: Drew, Ron

  To: ASP Web HowTo

  Sent: Friday, January 25, 2002 12:25 AM

  Subject: [asp_web_howto] MAPPATH





  One more question for you gurus out there....use of MapPath.  I have a 

directory with the MDB on my site.  If I am executing an ASP within the 

directory against the MDB I use this and it works fine......  Let say 

the directory for my.mdb is  D:\InetPub\wwwroot\club\directory1\my.mdb  

...so within this directory the asp works

  

  mdbPath =3D Server.MapPath("my.mdb")

     set objConn =3D Server.CreateObject("ADODB.Connection")

     objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _

                       "Data Source=3D" & mdbPath & ";" & _

                       "User Id=3Dadmin;" & _

                       "Password=3D;"     

  

  Problem is when I am in another directory on my website and try the 

access the MDB using the MapPath lets say D:\InetPub\wwwroot\club2\...it 

does not work.  I did a response.write on mdbPath and got   

D:\InetPub\wwwroot\club2\my.mdb  could not be found.  How can I correct 

the mdbPath setting using the Server.MapPath so that I can get at the DB 

anywhere in the site without having to hardcode the Data Source for the 

ASPs outside of the MDB directory???



    




$subst('Email.Unsub').










_________________________________________________________



Do You Yahoo!?



Get your free @yahoo.com address at http://mail.yahoo.com







Message #3 by "TomMallard" <mallard@s...> on Fri, 25 Jan 2002 09:33:38 -0800
This is a multi-part message in MIME format.



------=_NextPart_000_003E_01C1A583.5E458E00

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: 7bit



MessageTrue, you can use a hardcoded path if you know it. But using

mappath() results in more portable code that requires less maintenence for

server changes so is a better habit.



tom mallard

seattle

  -----[TomMallard]  Original Message-----

  From: sathish297@y... [mailto:sathish297@y...]

  Sent: Thursday, January 24, 2002 9:07 PM

  To: ASP Web HowTo

  Subject: [asp_web_howto] Re: MAPPATH





  Hi Drew,



     You need not use MapPath when you know the full path to the db.



  With Regards,

  R. Sathish Kumar,

  sathish297@y...



    ----- Original Message -----

    From: Drew, Ron

    To: ASP Web HowTo

    Sent: Friday, January 25, 2002 12:25 AM

    Subject: [asp_web_howto] MAPPATH





    One more question for you gurus out there....use of MapPath.  I have a

directory with the MDB on my site.  If I am executing an ASP within the

directory against the MDB I use this and it works fine......  Let say the

directory for my.mdb is  D:\InetPub\wwwroot\club\directory1\my.mdb  ...so

within this directory the asp works



    mdbPath = Server.MapPath("my.mdb")

       set objConn = Server.CreateObject("ADODB.Connection")

       objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _

                         "Data Source=" & mdbPath & ";" & _

                         "User Id=admin;" & _

                         "Password=;"



    Problem is when I am in another directory on my website and try the

access the MDB using the MapPath lets say D:\InetPub\wwwroot\club2\...it

does not work.  I did a response.write on mdbPath and got

D:\InetPub\wwwroot\club2\my.mdb  could not be found.  How can I correct the

mdbPath setting using the Server.MapPath so that I can get at the DB

anywhere in the site without having to hardcode the Data Source for the ASPs

outside of the MDB directory???








$subst('Email.Unsub').




$subst('Email.Unsub').






Message #4 by "Drew, Ron" <RDrew@B...> on Fri, 25 Jan 2002 13:03:17 -0500
This is a multi-part message in MIME format.



------_=_NextPart_001_01C1A5CA.90D45547

Content-Type: text/plain;

	charset="us-ascii"

Content-Transfer-Encoding: quoted-printable



You are correct for the most part, but what I was trying to do was have

a generic pointer independent of the site.

My local laptop has the mdb on    C:\InetPub\wwwroot\club\my.mdb  

but the ISP has the D:\InetPub\wwwroot2\club\my.mdb



This causes me to have to remember to comment and uncomment lines in the

code each time I change an asp.  The MapPath worked fine if the asp was

in the same directory as the MDB.  I think I now have the solution and I

am testing it.  I will now try this from my club2 directory.

mdbPath =3D Server.MapPath("../my.mdb")









-----Original Message-----

From: sathish297@y... [mailto:sathish297@y...]

Sent: Friday, January 25, 2002 12:07 AM

To: ASP Web HowTo

Subject: [asp_web_howto] Re: MAPPATH





Hi Drew,



   You need not use MapPath when you know the full path to the db.



With Regards,

R. Sathish Kumar,

sathish297@y...





----- Original Message -----

From: Drew, Ron <mailto:RDrew@B...> 

To: ASP Web HowTo <mailto:asp_web_howto@p...> 

Sent: Friday, January 25, 2002 12:25 AM

Subject: [asp_web_howto] MAPPATH



One more question for you gurus out there....use of MapPath.  I have a

directory with the MDB on my site.  If I am executing an ASP within the

directory against the MDB I use this and it works fine......  Let say

the directory for my.mdb is  D:\InetPub\wwwroot\club\directory1\my.mdb

...so within this directory the asp works



mdbPath =3D Server.MapPath("my.mdb")

   set objConn =3D Server.CreateObject("ADODB.Connection")

   objConn.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _

                     "Data Source=3D" & mdbPath & ";" & _

                     "User Id=3Dadmin;" & _

                     "Password=3D;"     



Problem is when I am in another directory on my website and try the

access the MDB using the MapPath lets say D:\InetPub\wwwroot\club2\...it

does not work.  I did a response.write on mdbPath and got

D:\InetPub\wwwroot\club2\my.mdb  could not be found.  How can I correct

the mdbPath setting using the Server.MapPath so that I can get at the DB

anywhere in the site without having to hardcode the Data Source for the

ASPs outside of the MDB directory???



  




$subst('Email.Unsub').






$subst('Email.Unsub').







  Return to Index