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

Linked Tables and updating

Status
Not open for further replies.

emeryp

Programmer
Feb 2, 2003
25
US
Hi Everyone,
Has anyone automatically updated their linked tables? I have used the linked table manager to perform the update, but am looking for a way to perform this in my code in VB 6.0. Looking around, it looks like the DoCmd may help? Any ideas would be helpful.
Emery
 
Create a Link Example.

Function ADOCreateAttachedODBCTable()

Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table

' Open the catalog
cat.ActiveConnection = CurrentProject.Connection

' Set the name and target catalog for the table
tbl.Name = "Titles"
Set tbl.ParentCatalog = cat

' Set the properties to create the link
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Provider String") = _
"ODBC;DSN=ADOPubs;UID=sa;PWD=;"
tbl.Properties("Jet OLEDB:Remote Table Name") = "titles"

' Append the table to the collection
cat.Tables.Append tbl

Set cat = Nothing

End Function

 
Thank you cmmrfrds,
Now am I correct in assuming that the tables will automatically update when I issue the refresh command?
emery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top