# Re: 如何得知 在.MDB档中有某一TABLE存在?

Posted by Nicky on December 24, 1998 at 17:23:36:

In Reply to: 如何得知 在.MDB档中有某一TABLE存在? posted by jan on December 24, 1998 at 10:03:42:

: 请问: 应如何得知在 TMP.MDB 资料库中, 是否有 TEST 的TABLE 存在?

Dim I as integer
Dim db as database
Dim Bo as Boolean

Set Db = DBEngine.Workspaces(0).OpenDatabase("C:\Tmp.mdb", False, False)
For I = 0 To Db.TableDefs.Count - 1
If InStr(Tmp.TableDefs(I).Name,"TEST")
Bo=true
exit for
End if
Next I

if bo then
'找到了,在这加上Logic
else
'找不到,在这加上Logic
end if

Follow Ups: