Access, VB
There must be a simpler way to test if a table exists in Access rather than having to loop arround all the objects ... isn't there? My code is:
(PS I know I posted this as part of another post but did not get a reply ... see How to add ODBC linked table in an Access database where I still have a problem with creating the primary key to a linked table)VB Code:
Dim catLocal As ADOX.Catalog Dim tblLinked As ADOX.Table Dim lintTable As Integer Dim lblnTable as boolean ' Create a connection to QuoteWerks Set catLocal = New ADOX.Catalog catLocal.ActiveConnection = lcnnQW ' Loop arround all the objects For lintTable = 0 To catLocal.Tables.Count - 1 If CStr(catLocal.Tables.Item(lintTable).Name) = lstrQWTable Then lblnTable = True Exit For End If Next ' Table




Reply With Quote