Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate switch of web page ODBC recordsource

Status
Not open for further replies.

EITech

Programmer
Oct 15, 2000
13
0
0
US
The intranet uses one of 2 .mdb's as a recordsource. The ODBC connection has to be manually switched to point at the .mdb for the day. They are alternated because they need to be compacted & repaired daily, and something about the intranet connection causes an .ldb to be open all the time, so it's not possible to c & r the one that is the current ODBC connection. This is using A97 and Windows NT 3.51.
The question: I would like to automate this whole process. I know how to automate the c & r, etc., but have no idea how to change the ODBC connection. Presumably this involves an API call or, worse, writing something in C++? Which I don't know at all.
Can anybody help with this? Thanks!
 
try using ADO and connection string.You can easily automate task of changing connection string and it will be more easy
 
How do you store the information about the connection? Is it in a Session variable, an Application variable, out of the registry, ...

One way to do it would be to have the connection information stored in an Application variable. Each page that references the database opens the connection at the top of the page referring to the Application variable. You need to ensure that you close the connection on every page as well.

Then you need a page which allows you to change the value of the application variable and voila - all pages now use the new database.

Chaz
 
Oh, btw - this won't work if you use some kind of server farm on your intranet. In that case, you're on your own.

Chaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top