Check table exists or not

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

Could anyone tell me how to check the table exists or not in access.

Thanks,
Jason.
 
Jason,

Use function:

DLookup("[Name]","MSysObjects","[Name]= 'TableName' And [Type] = 1")

Where TableName is the name of the table you are looking for. If it
exists the function will return the table name, otherwise it wil return
Null.

HTH,
Nikos
 
IIRC, [Type] = 1 will only pick up local Tables.

If the Table is an Access-linked Table, [Type] = 6.

If the Table is an ODBC-linked Table, I believe [Type] = 4.

--
HTH
Van T. Dinh
MVP (Access)




Nikos Yannacopoulos said:
Jason,

Use function:

DLookup("[Name]","MSysObjects","[Name]= 'TableName' And [Type] = 1")

Where TableName is the name of the table you are looking for. If it
exists the function will return the table name, otherwise it wil return
Null.

HTH,
Nikos
Dear all,

Could anyone tell me how to check the table exists or not in access.

Thanks,
Jason.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top