Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function ifTableExists(tblName As String) As Boolean
- ifTableExists = False
- If DCount("[Name]", "MSysObjects", "[Name] = '" & tblName & "'") = 1 Then
- ifTableExists = True
- End If
- End Function
- Exists = IsObject(CurrentDb.TableDefs(tablename))
- Function IsTable(sTblName As String) As Boolean
- 'does table exists and work ?
- 'note: finding the name in the TableDefs collection is not enough,
- ' since the backend might be invalid or missing
- On Error GoTo hell
- Dim x
- x = DCount("*", sTblName)
- IsTable = True
- Exit Function
- hell:
- Debug.Print Now, sTblName, Err.Number, Err.Description
- IsTable = False
- End Function
- SELECT Count([MSysObjects].[Name]) AS [Count]
- FROM MSysObjects
- WHERE (((MSysObjects.Name)="TblObject") AND ((MSysObjects.Type)=1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement