|
|
Title | See if a table exists in a DAO database |
Description | This example shows how to see if a table exists in a DAO database in Visual Basic 6. |
Keywords | DAO, database, table, table exists |
Categories | Database |
|
|
The TableExists function loops through the DAO Database object's TableDefs collection looking for the target table.
|
|
Private Function TableExists(ByVal db As DAO.Database, _
ByVal table_name As String) As Boolean
Dim td As TableDef
table_name = UCase$(table_name)
TableExists = True
For Each td In db.TableDefs
If UCase$(td.Name) = table_name Then Exit Function
Next td
TableExists = False
End Function
|
|
|
|
|
|