Refresh linked/imported tables programmatically 
Author Message
 Refresh linked/imported tables programmatically

Hi there!

I am currently working with an Access database that uses linked/imported
tables from an InterBase database.  What I would like to know is: how can I
programmatically refresh the linked tables and reimport the imported tables
everytime the database is opened?

Thanks for any suggestions.

Pamela



Sun, 10 Dec 2000 03:00:00 GMT  
 Refresh linked/imported tables programmatically
For imported tables, the simplest method is using Docmd.TransferDatabase
after deleting the table.

For linked tables, all you have to do is change the table "Connect"
property and then use the "RefreshLink" method. Something like this:

Function RelinkTab (name_tab as String, name_database as String) as
Boolean
Dim td as Tabledef, dbs as Database

'Returns True if there is an error
RelinkTab = True
On Error Goto Lbl_error

'I never know when this is needed; sometimes currentdb is enough
Set dbs = Workspaces(0).Databases(0)

Set td = dbs.Tabledefs(name_tab)
With td
  .Connect= <something (1)> & name_database
  .RefreshLink
  End With

RelinkTab = False

'No error ...
Exit Function

Lbl_error:
' Error condition code ...
End Function

Good luck.

--
Best Regards

J. Mario Pires
---
Please send me a copy by email if you reply to a newsgroup

************

Quote:

> Hi there!

> I am currently working with an Access database that uses linked/imported
> tables from an InterBase database.  What I would like to know is: how can I
> programmatically refresh the linked tables and reimport the imported tables
> everytime the database is opened?

> Thanks for any suggestions.

> Pamela



Sun, 24 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Linked Table VS Import Table

2. Linked Table VS Import Table

3. how to programmatically create linked table w/o access

4. Need to link a table to a text file programmatically

5. Creating and deleting referential table links programmatically

6. Programmatically remove linked tables

7. programmatically link tables

8. How do I programmatically create a linked FoxPro table

9. Importing data into linked tables

10. Problem importing a text file to a linked table in Access 2000

11. Adding a new Field to a Linked (or Imported) Table

12. difference between import and linking of outlook table

 

 
Powered by phpBB® Forum Software