如果表存在

扫码查看
在查询中可能相当慢,具体取决于行数。 如果有另一个名为tblName的非表对象怎么办? ? - 莱尔费尔菲尔德 Hi ,does any knows how can i check the existence of a table in a ms accessdatabase ?i need a sql statement that provide this function.Thanks . 解决方案Create a new module. AddPublic Function ifTableExists(tblName as String) as BooleanifTableExists = FalseIf DCount("[Name]","MSysObjects","[Name] = ''" & tblName & "''") = 1 thenifTableExists = TrueEndifEnd FunctionIt might be pretty slow in a query, depending on the # of rows. Create a new module. Add Public Function ifTableExists(tblName as String) as Boolean ifTableExists = False If DCount("[Name]","MSysObjects","[Name] = ''" & tblName & "''") = 1 then ifTableExists = True Endif End Function It might be pretty slow in a query, depending on the # of rows.What if there''s another non-table object named tblName?--Lyle Fairfield 这篇关于如果表存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-18 23:21
查看更多