删除数据问题!
游子 2010-08-22 06:06:57 Dim strSQL As String
Dim myBookmark As Variant
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str2 As String
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
cnn.CursorLocation = adUseClient
cnn.ConnectionString = connstr
cnn.Open
rs.Open "SELECT * FROM to_repeat where yz_date between' " + Str(DTPicker1.Value) + "' and '" + Str(DTPicker2.Value) + "' order by yz_date", cnn
str2 = MsgBox("确定要删除查询到的数据?", vbOKCancel, "提示")
If str2 = vbOK Then
If (DTPicker1.Value <> "") Then
rs.Delete
rs.MoveNext
MsgBox "删除成功", vbOKOnly + vbInformation, "提示"
rs.Close
Set cnn = Nothing
End If
End If
为什么只删除一条数据呢??明明查到N条啊。。