Atlas said:
Is it possible to change the SQL server properties in my project at startup,
to switch from a test db to a production one?
Actually the server name, cause the database and the table names will be
thesame.....
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
..MDB/E front-ends (Access 2000 & greater versions): Change the
connection string on each of your linked tables & SQL Pass-Thru queries.
E.g. (substitute your DB names for my example DB names):
dim db as dao.database
dim td as dao.tabledef
dim strConnect as string
set db = currentdb
set td = db.tabledef("TableName")
strConnect = td.Connect
strConnect = Replace(strConnect, "Database=TestDB", _
"Database=ProductionDB")
td.Connect = strConnect
td.RefreshLink
[basically the same for QueryDefs]
..ADP/E front-ends: Change the ProjectConnection string. E.g.:
dim strConnect as string
strConnect = CurrentProject.BaseConnectionString
strConnect = Replace(strConnect, "Catalog=TestDBName", _
"Catalog=ProductionDBName"
CurrentProject.OpenConnection(strConnect)
What it does: Gets the current connection string to the Test DB &
replaces the Catalog/Database name w/ the production DB name; then sets
the current project's connection to that new connection.
- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQGxa3oechKqOuFEgEQIRewCgg5Y8dyRzG8XQuFmWSEuewikX2TwAoO/3
IFV+JtVW1DJNgO5zjFb5oMrJ
=9r6+
-----END PGP SIGNATURE-----