你可以这样用
Adodc.movefirst
Adodc.movenext
因为 你打开一个Adodc 就已经是一个确定的记录集了,都是符合你的条件的不过 你可以加参数在ado.command 的对象上
例如:在数据环境里面添加 连接和命令对象
Conn 和Cmd1
这样用conn.cmd1 参数1,参数2,...cmd1 里面必须有参数 ? 这个东西例如 select * from table1 where aa=?对了 这个问号就是参数
然后 你可以随心所欲的操作数据了多看看msdn 很有用的
Adodc.movefirst
Adodc.movenext
因为 你打开一个Adodc 就已经是一个确定的记录集了,都是符合你的条件的不过 你可以加参数在ado.command 的对象上
例如:在数据环境里面添加 连接和命令对象
Conn 和Cmd1
这样用conn.cmd1 参数1,参数2,...cmd1 里面必须有参数 ? 这个东西例如 select * from table1 where aa=?对了 这个问号就是参数
然后 你可以随心所欲的操作数据了多看看msdn 很有用的
rs.open "select * from tableName where fieldName='xx'",conn,3,3
返回的都是符合条件的记录。
if not .eof then rs.movefirst
然后用
if not rs.eof then rs.movenext 即可找到所有的符合条件的记录
可选的Value如下:
adSeekFirstEQ 1 Seeks the first key equal to KeyValues.
adSeekLastEQ 2 Seeks the last key equal to KeyValues.
adSeekAfterEQ 4 Seeks either a key equal to KeyValues or just after where that match would have occurred.
adSeekAfter 8 Seeks a key just after where a match with KeyValues would have occurred.
adSeekBeforeEQ 16 Seeks either a key equal to KeyValues or just before where that match would have occurred.
adSeekBefore