|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How Do I create a db connection path that will be the same on different web servers
<i><b>Originally posted by : KevinM (mullarkey@fs5.ee.umist.ac.uk)</b></i><br />I develop and test my asp pages locally using PWS.<br />But when I upload to the main web server the path connect string to the db will be different.<br />Is there any way I can set up the path so it will be automatically be seen regardless of the web server.<br /><br />The problem is that the main web server has several added paths and sub webs before it gets to the location of the db.<br /><br />Many Thanks<br /><br />Kevin M<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Eric H (ek1667@hotmail.com)</b></i><br />This is called a DSNless Connection to<br />the Database<br /><br />strConn = "DBQ=" & Server.Mappath("database.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"<br /><br />The Server.Mappath will give you the physical path on the server hard drive pointing to your directory. If you need to get into subfolders to locate your database then you just have to use Server.Mappath("sub-folder/sub-folder/database.mdb")...etc...<br /><br />Set conn = Server.CreateObject("ADODB.Connection")<br />conn.open strConn<br /><br /><br />
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > How Do I create a db connection path that will be the same on different web servers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|