name应该是数据库中的一个表名。
解决方案 »
- 如何设置RICHTEXTBOX的第一可见行?
- 求助:同样一段小程序,作为VBA放在excel中和VB程序中单独使用速度相差很大
- 如何在vb里实现两台电脑间的远程文件传输,有没有好用的dll或ocx?
- VB+ADO+ORACLE !如何给取出一个TABLE表的所有字段和类型!
- 用vb6創建odbc為什麼不行?進入看代碼 ?
- Api中setBkmode和setBkcolor函数在什么情况下使用,怎样使用?求助!
- 怎样在主窗体最小化时,其他窗体同时最小化?
- 在VB里用ADO的CONNECTION对象执行SQL的问题
- VB默认的控件怎么样用(连接access)最好有实例好用一定给分
- ActiveX Dll 问题,高手请进!!!!!
- 关于文件打开的问题。
- 在ListView中,如何得到光标附近的ListItem的信息,如Index、Key等?
db.Execute "Delete From name"即可删除所有记录。
先判断
IF 表中的记录数=1 THEN
db.Execute "Delete From name"
ELSE
do while not rs.eof and not rs.bof
rs.movefirst
rs.delete
loop
END IF
if not rs.bof then rs.movefirst
if not rs.eof then rs.movelast
debug.print rs.recordcountUse ADO:
if not (rs is nothing) then debug.print rs.recordcountdelete from tablename-------->delete all records in table
dim db as database
dim rs as recordset
set db=opendatabse(path+"数据库文件名.mdb")
set rs=db.openrecordset("name") 'name为数据表中的一个字段
rs.movefirst
do while not rs.eof
rs.delete
rs.movenext
loop