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

DAO to ADO (Linking Tables) 1

Status
Not open for further replies.

gavinjb

Programmer
Apr 24, 2003
106
GB
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,
 
Not sure if this helps

DoCmd.TransferDatabase acLink, "ODBC Database", _
"ODBC;DSN=DataSource1;UID=User2;PWD= _
& "DATABASE=pubs", acTable, "Authors", "dboAuthors"

I got this outta help.

DougP, MCP, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top