怎能通过adodc删除access数据库某个表的内容?
怎能通过adodc删除access数据库某个表的内容?
[解决办法]
Dim Cn As New ADODB.Connection
Dim Cmd As New ADODB.Command
Cn.Open "test.mdb "
Set Cmd.ActiveConnection = Cn
Cmd.CommandText = "DROP TABLE tab "
Cmd.Execute
Set Cn = Nothing
Set Cmd = Nothing
[解决办法]
'此为删除整个表的结构和数据
Cmd.CommandText = "DROP TABLE tab "
'删除表的所有数据
Cmd.CommandText = "TRUNCATE TABLE tab "