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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Link Tables on Startup

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
I am attempting to refresh the tables when the users start the program everyday. the application is an Access 2000 application with a SQL Server backend. So far i have the code below on the onload event.

Dim CNN As ADODB.Connection
Dim CAT As ADOX.Catalog
Dim TBL As ADOX.Table

Set CNN = CurrentProject.Connection
Set CAT = New ADOX.Catalog
CAT.ActiveConnection = CNN

For Each TBL In CAT.Tables
TBL.Properties("Jet OLEDB:Link Provider String") = "ODBC;DSN=Bar Examiners;Database=Trainging2"
Next

however, when i execute this code i recieve the following error message:

Run-time error '-2147467259(80004005)':
ODBC--connection to 'Bar Examiners' failed.

There seems to be endless possiblities as to why this didn't work, any idea?

Jason [noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top