|
 |
access_asp thread: how to change the data source path when publish it to outside ISP
Message #1 by "Ping Li" <pli@l...> on Tue, 20 Nov 2001 18:58:56
|
|
Hello, I have a emergency here and hope anyone can give a hand ASAP.
In chapter 15 of the "Beginning ASP 3.0" book, the example application
uses a classified Access database. But it stores the classified.mdb in the
local hard drive such as in following code (Page 662):
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\datastores\classified.mdb"
My question is: I am developing a website using FrontPage 2000, if I have
to publish my website to outside ISP rather than to my own server, how can
I change the data source path? I am not sure the c:\...path would be
changed automatically after uploading the files to my ISP.
Thank you very much for your help.
Sincerely,
Ping Li
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 21 Nov 2001 12:29:35 +1100
|
|
Store the connection string in an application variable in your global.asa.
Then, in your pages you do:
objConn.Open Application("DBConnString")
Then, when you need to change the connection string you just change it in
one place, and all your pages start using the new connection string.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Ping Li" <pli@l...>
Subject: [access_asp] how to change the data source path when publish it to
outside ISP
: Hello, I have a emergency here and hope anyone can give a hand ASAP.
:
: In chapter 15 of the "Beginning ASP 3.0" book, the example application
: uses a classified Access database. But it stores the classified.mdb in the
: local hard drive such as in following code (Page 662):
:
: Dim objConn
: Set objConn = Server.CreateObject("ADODB.Connection")
: objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
: "Data Source=C:\datastores\classified.mdb"
:
: My question is: I am developing a website using FrontPage 2000, if I have
: to publish my website to outside ISP rather than to my own server, how can
: I change the data source path? I am not sure the c:\...path would be
: changed automatically after uploading the files to my ISP.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |