mhx希望之证:VB+SQL 如何用游标删除记录
来源:百度文库 编辑:高校问答 时间:2024/10/03 04:46:56
rs是查询记录集
如何用delete from where 游标的方法删除所指的一个记录?
可是这样会把限定条件中的满足的都删了阿,怎么能删除rs所指向的记录?
如何用delete from where 游标的方法删除所指的一个记录?
可是这样会把限定条件中的满足的都删了阿,怎么能删除rs所指向的记录?
Dim conn as new adodb.connection
Dim rs As New ADODB.Recordset
Dim strsql As String
conn.connectstring="你的连接字符串" '连数据库
strsql= "delete from 表名 where 你的限定条件"
rs.LockType = adLockOptimistic
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.Open strSql, strConn
rs.update '更新记录
rs.requery '刷新结果集