I have an Access97 database and I would like to link a SQL table to it
without having to create a manual ODBC connection on every system that
needs to use this database.
This is what I have so far to make the ODBC connection:
Dim DBconnect As Object
Dim CnnStr As String
CnnStr = "Provider=sqloledb;" & _
"Data Source=servername;" & _
"Initial Catalog=odbc-connection-name;" & _
"User ID=username;Password=;"
Set DBconnect = CreateObject("ADODB.Connection")
DBconnect.ConnectionString = CnnStr
This code works fine to create the connection. What I need now, is the
code to create the actual link to the "openord" table in the "proddata"
database on that SQL server.
I guess it would be a good idea to check to see if the table exists and
if it does to skip the link connection. Otherwise it may give an error
that the link is already there?
Thanks for any help !