I am trying to convert some old Access 97 DAO code to ADOX, to use for Linking Tables, can any one help me/give me some pointers on what I need to do to convert the following proc to ADOX.
Sub UpdateLink(strTableName As String, strDatabaseName As String)
On Error GoTo UpdateLink_Error
Dim tdf As TableDef
Dim dbsDb As Database
Set dbsDb = currentDB
' Set object to point to table
Set tdf = dbsDb.TableDefs(strTableName)
'Specify the new location of the source table.
tdf.Connect = ";DATABASE=" & strDatabaseName
' Refresh the Link.
tdf.RefreshLink
Exit Sub
UpdateLink_Error:
MsgBox "The following error occurred: " & Error$
Resume Next
End Sub
Thanks,
Gavin,
Sub UpdateLink(strTableName As String, strDatabaseName As String)
On Error GoTo UpdateLink_Error
Dim tdf As TableDef
Dim dbsDb As Database
Set dbsDb = currentDB
' Set object to point to table
Set tdf = dbsDb.TableDefs(strTableName)
'Specify the new location of the source table.
tdf.Connect = ";DATABASE=" & strDatabaseName
' Refresh the Link.
tdf.RefreshLink
Exit Sub
UpdateLink_Error:
MsgBox "The following error occurred: " & Error$
Resume Next
End Sub
Thanks,
Gavin,