如何删除某字段为空的记录集?
RS1.Open "Select * from sel ", Conn, adOpenKeyset, adLockPessimistic
RS1.Move First
For i = 1 To RS1.RecordCount
If IsNull(RS1.Fields(2)).Value) Then
RS1.Delete
End If
RS1.MoveNext
Next
RS1.Close
如何删除某字段为空的记录集?上面的代码没有错,但是总是有一部分为空的记录集没有被删掉,请问这是什么原因?
[解决办法]
1,不是很清楚你的要求。
2,where a matches '*DD*'
数据库不同,语句可能有不同。
[解决办法]
'删除字段a为NULL的记录
conn.execute " delete from tablename where a IS NULl "