Click to See Complete Forum and Search --> : Is table exist
farah
Jun 13th, 1999, 12:13 PM
Hello everyone,
How can I chech if the table is exist in a database? Just in case if someone delete my table inside a database.
Serge
Jun 13th, 1999, 03:02 PM
Let's say you are looking for a table named MyTable.
Then you would use something like:
Dim db As Database
Dim tb As TableDef
Set db = Workspaces(0).OpenDatabase("C:\MyDB.mdb")
For each tb In db.TableDefs
If tb.Name = "MyTable" Then
'You found your table
Exit For
End If
Next
Best regards,
------------------
Serge
Serge_Dymkov@vertexinc.com
Access8484@aol.com
If you have any questions about AOL programming, e-mail me
ccox
Jun 15th, 1999, 08:37 PM
In oracle you could try selecting for the table name against the TAB table.
Chip
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.