# Re: 请问如何侦测资料库中的某个Table是否存在??

Posted by SUNG on September 19, 1999 at 12:00:30:

In Reply to: Re: 请问如何侦测资料库中的某个Table是否存在?? posted by 小琳 on September 18, 1999 at 20:03:59:

: : 用VB程式还是用SQL语法??

: :::SQL语法应该没有这种功能!!!

以下给你参考!
DB是用MSDBJET打开的资料库!TBNAME是要检查的TABLE NAME!
Public Function ISTABLE(DB As Database, TBNAME As String) As Boolean
Dim TB As DAO.TableDef
ISTABLE = False
For Each TB In DB.TableDefs
If TB.Attributes = 0 And Trim(TB.Name) = Trim(TBNAME) Then
ISTABLE = True
Exit For
End If
Next
Set TB = Nothing
End Function

Follow Ups: