在ADODB里的统计记录总数与删除记录??
运行环境:vb 6.0 + access 2003
代码所在位置 command1 里。
dim x,y as Integer
x=记录总数
if x<=115 then
exit if
else
y=x-115
movefirst
删除y条记录
end if
请高手们将上面代码中的记录总数和删除y条记录,
修改成代码,并确认可以运行,谢谢!
[解决办法]
x1 = .RecordCount
For i = 1 To y
.Delete
.MoveNext
Next
[解决办法]
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
cnn.CursorLocation = adUseClient
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"C:\Documents and Settings\Administrator\My Documents\" & _
"11.mdb;Persist Security Info=False"
Set rst = cnn.Execute("select * from itb1")
x1 = rst.RecordCount