I would like to check in VB code if a table exist. How do I do that?
Check if table exist
Collapse
X
-
Hi,
could you try this code?. i hope it's very useful for you.
ThanksCode:Public Function TableExistsADO(ByVal strDB As String, strTable As String) As Boolean On Error GoTo Hell Dim RS As Recordset Set RS = New Recordset RS.Open "SELECT * FROM " & strTable & " WHERE 1=0", _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & strDB TableExistsII = True Exit_For: If RS.State = adStateOpen Then RS.Close Set RS = Nothing Exit Function Hell: GoTo Exit_For End Function
Comment