用vb删除access数据库表中的记录,删除第1至8条时运行datPrimaryRS.Recordset.UpdateBatch系统提示错误但删除第8条以后的记录系统运行正常,不知道这是什么原因请高手指点代码如下
On Error GoTo DeleteErr
With datPrimaryRS.Recordset
.Delete
datPrimaryRS.Recordset.UpdateBatch
If datPrimaryRS.Recordset.RecordCount > 0 Then If .EOF Then
.MoveLast
Else
.MoveNext
End If
End If
On Error GoTo DeleteErr
With datPrimaryRS.Recordset
.Delete
datPrimaryRS.Recordset.UpdateBatch
If datPrimaryRS.Recordset.RecordCount > 0 Then If .EOF Then
.MoveLast
Else
.MoveNext
End If
End If
你就这样:
datPrimaryRs.Open "delete from (表名) where (条件)",(连接条件)
O 了。
绝对不“木”。
用ADO的Connection执行如下内容
delete from yourtable