Connecting Tech Pros Worldwide Forums | Help | Site Map

how do i open a linked table?

Newbie
 
Join Date: Nov 2008
Posts: 13
#1: Dec 4 '08
If a table is imported into the database, we write:
Dim rst_p, rst_r As DAO.Recordset
Set db = CurrentDb
Set rst_p = db.OpenRecordset("Pol", dbOpenTable)
Set rst_r = db.OpenRecordset("Rid", dbOpenTable)
But if the tables are linked instead, what code should i write to open it?

Thank you very much!

Expert
 
Join Date: Jul 2008
Location: Maryland
Posts: 1,176
#2: Dec 4 '08

re: how do i open a linked table?


The code doesn't change at all.
Expert
 
Join Date: Jun 2007
Location: Derbyshire, UK
Posts: 347
#3: Dec 4 '08

re: how do i open a linked table?


Quote:

Originally Posted by kwokv616 View Post

If a table is imported into the database, we write:
Dim rst_p, rst_r As DAO.Recordset
Set db = CurrentDb
Set rst_p = db.OpenRecordset("Pol", dbOpenTable)
Set rst_r = db.OpenRecordset("Rid", dbOpenTable)
But if the tables are linked instead, what code should i write to open it?

Thank you very much!

Hi

I find that if you omit the dbOpenTable 'Type' argument then it works OK, In fact only 3 of the 5 'Type' arguments seem to work with a link table name.

I cannot comment further as I only use ADO recordset (at least for the last 8 years!).


MTB
Reply