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.
 
Back
Top