Creating a recordset of a table in an external database

S

Shadow

Hello,

I have two databases and each one contains several
tables, forms.......(database A and database b)
I need to create a recordset of a table in database A while I'm running some
vba codes in a module in database B.
While the following code creates a recordset from a table in current
database, how can I create a recordset from a table in an external database?
set db=currentdb
set rst=db.openrecordset("tblname")

Any kind of help is much appreciated.


Ghalamkari
 
J

Jörg Ackermann

Shadow said:
I have two databases and each one contains several
tables, forms.......(database A and database b)
I need to create a recordset of a table in database A while I'm
running some vba codes in a module in database B.
While the following code creates a recordset from a table in current
database, how can I create a recordset from a table in an external
database? set db=currentdb
set rst=db.openrecordset("tblname")

set db= Opendatabase(path)
set rst=db.openrecordset("tblname")

see OpenDatabase-method in Help
 
S

Shadow

Jörg Ackermann,
Million thanks for your quick response and great help.
Exactly what I was looking for.

Best Regards
Ghalamkari
 
S

Shadow

So many ways to do the same task and I wasn't aware of a single one. It
seems I have to study a little bit more.

I just don't know how to thank you for the solutions.
Ghalamkari
 
Top