Refrencing Another DB

  • Thread starter Thread starter Ant
  • Start date Start date
A

Ant

Hi All,

I have a Access 2000 Database that links to muliple
backends depending on your choice.

I am looking for a way to create a recordset of the names
of tables in a seperate database so that I can run a check
that a table exists before attempting to link to that
table. How do you search or create a list of the tables in
a database that is not the one you currently have open?

Thanks in Advance,

Ant
 
Ant said:
I have a Access 2000 Database that links to muliple
backends depending on your choice.

I am looking for a way to create a recordset of the names
of tables in a seperate database so that I can run a check
that a table exists before attempting to link to that
table. How do you search or create a list of the tables in
a database that is not the one you currently have open?


Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String

strSQL = "SELECT MSysObjects.Name " & _
"FROM MSysObjects IN 'path to other .MDB' " & _
"WHERE MSysObjects.Type=1 AND MSysObjects.Flags=0"
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
. . .
rs.Close : Set rs = Nothing
Set db = Nothing
 
Back
Top