判断数据库中是否存在一张表,为什么这段代码老是报错?
For i = 0 To CurrentDb.TableDefs.Count - 1If "EXPORT" = CurrentDb.TableDefs(i).Name Then '如果EXPORT真的存在了,这一句就会报错!
DoCmd.DeleteObject acTable, "EXPORT"
End If
Next
拜托各位
Sub main_DeleteTab调用示例() Dim t1 As String, result As Boolean t1 = "档期定义" '要删除的表名 result = DropTable(t1) '返回逻辑值 End Sub Public Function DropTable(ByVal tabName As String) As Boolean On Error GoTo err1: DoCmd.DeleteObject acTable, tabName DropTable = True err1: Exit Function End Function