This topic is locked

Help with Database Connection String

2/8/2010 9:55:22 AM
ASPRunnerPro General questions
M
mccreelake author

Hello:
Is it possible to dynamically edit the database connection string? I would like to be able to have a simple database table where the database name, username, and password to connect to the database are stored and can be dynamically change. For example, I may want to switch from the production to the test database.
Thanks,
McCree

Sergey Kornilov admin 2/8/2010

You can use AfterApplicationIntialized event and overwrite strConnection variable i.e.

strConnection = "Driver={Microsoft Access Driver (*.mdb)};DBQ="" & Server.MapPath(""db\examples.mdb"") & "";Uid=;Pwd="