One of the databases I support uses linked tables so, to keep links up to date code was added to automatically relinks the tables to the SQL Server back-end through an ODBC connection. This code was developed and working great in Access 2000 but since we have converted to 2002 I just get an invalid table reference error. I couldn't find any articles in Microsoft's Knowledge base that would indicate that syntax had changed. Has anyone else run into this problem when upgrading to Access '02? Any ideas on another way this can be done? The code for this is as follows.
Thanks in advance for your help!
Code:
Dim CNN As ADODB.Connection
Dim CAT As ADOX.Catalog
Dim TBL As ADOX.Table
CNN = CurrentProject.Connection
Set CAT = New ADOX.Catalog
CAT.ActiveConnection = CNN
For Each TBL In CAT.Tables
If TBL.Type = "PASS-THROUGH" Then
TBL.Properties("Jet OLEDB:Link Provider String") = "ODBC;DSN=ClientData;Database=ClientData;"
End If
Next TBL