[dba-SQLServer]SWAP DBs

Jim Lawrence (AccessD) accessd at shaw.ca
Tue Nov 25 19:22:26 CST 2003


Hi Martin:

Public gstrConnection01 as string
Public gstrConnection02 as string
Public gstrConnection03 as string

gstrConnection01 = "Provider=SQLOLEDB;Initial Catalog=Registration;Data
Source=AGVIC47;Integrated Security=SSPI"
gstrConnection02 = "Provider=SQLOLEDB;Initial Catalog=Registration;Data
Source=winserver;Integrated Security=SSPI"
gstrConnection03 = "Provider=SQLOLEDB;Initial Catalog=Registration;Data
Source=imgserver;Integrated Security=SSPI"
gstrConnection04 = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security
Info=False;Data Source=\\imgserver\appl\rod.mdb"

Above is some code pulled from a couple of my Access apps. Notice I have
openned three SQL DBs, One is at work, one SQL7 version on an older server,
in my home office and one a SQL2000, on the new home server. The other
reference is to a clients MDB, just for fun. You can just swap connection
strings depending on a whim or a requirements. You can then use a couple of
tables, from two different DBs to populate a reordset and update a third set
of tables in another DB..this asssumes you are using ADO...recordsets.

I am current working on a VB app that is using a MDB BE and transfers
product updates and receives order requests from the client's webserver that
is using a MsSQL DB BE. (and a PHP/HTML FE). It seems to be working though
it is a long way until completion.

HTH
Jim

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Martin
Reid
Sent: Tuesday, November 25, 2003 10:21 AM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer]SWAP DBs


I need to be able to swap into different databases from Access.

Anyone have an example of swapping the connection to point to another SQL
Server DB


Martin

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



More information about the dba-SQLServer mailing list