Does this table exist (1 Viewer)

sconly

Registered User.
Local time
Today, 04:09
Joined
Oct 8, 2002
Messages
56
how can i use vba to check if a table exists in a database that resides on the network.

example:
db1 has a form which has a button that creates a table in db2.
db2 is on the network server, does table created thru db1 already exist in db2 ?

Matt
 

GJT

Registered User.
Local time
Today, 04:09
Joined
Nov 5, 2002
Messages
116
Matt

You need to create a DB object and open the database. You can then query the TableDefs collection - this contains all the tables on the remote database.

Dim db as Database, i as Integer

Set db = OpenDatabase("\\network\database\db.mdb")

For i = 0 To db.TableDefs.Count
Debug.Print db.TableDefs(i).Name
Next i

Simply write a function to check the each TableDef entry against the table name you are looking for......

L8rs
G
 

Users who are viewing this thread

Top Bottom