快速清空Access资料库中所有表的数据
新建模块——>贴上下面代码——>运行
Function ClearAllData() Dim rst As Object DoCmd.SetWarnings False Set rst = CreateObject("ADODB.Recordset") rst.Source = "Select [Name] FROM MSysObjects Where Type=1 AND Not [Name] Like 'MSys%'" rst.Open , CurrentProject.Connection Do Until rst.EOF DoCmd.RunSQL "Delete FROM [" & rst![Name] & "]" rst.MoveNext Loop rst.Close DoCmd.SetWarnings True End Function