如果你想找表Table007是否存在,则 select name from sysobjects where type='u' and name='table007'
select * from sysobjects where type = 'u' 然后再慢慢找吧
1.select * from sysobjects where type = 'u' 再find2.OpenSchema(adSchemaTables) '********************************************************* '* 名称:TableExists '* 功能:判断表是否存在(表名) '* 用法:TableExists(表名) adoCN是一个SQL的连接 '********************************************************* Public Function TableExists(findTable As String) As Boolean Dim rstSchema As New ADODB.Recordset Set rstSchema = adoCN.OpenSchema(adSchemaTables) rstSchema.Find "TABLE_NAME='" & findTable & "'" If rstSchema.EOF Then TableExists = False Else TableExists = True End If rstSchema.Close End Function
select name from sysobjects where type='u' and name='table007'
然后再慢慢找吧
再find2.OpenSchema(adSchemaTables)
'*********************************************************
'* 名称:TableExists
'* 功能:判断表是否存在(表名)
'* 用法:TableExists(表名) adoCN是一个SQL的连接
'*********************************************************
Public Function TableExists(findTable As String) As Boolean
Dim rstSchema As New ADODB.Recordset
Set rstSchema = adoCN.OpenSchema(adSchemaTables)
rstSchema.Find "TABLE_NAME='" & findTable & "'"
If rstSchema.EOF Then
TableExists = False
Else
TableExists = True
End If
rstSchema.Close
End Function