关于ADO数据库访问的问题(30分) 用 if rs.eof then ……试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if rs.bof and rs.eof then ....end if或者if rs.recordcount=0 then (只法不安全) 请问如何删除合符条件的数据啊。Text1.Text=3rs.Open "select * from pp where id=" & Text1.Text, cn, 1, 1比如说现在找到了ID=3的记录了,接着如何写。 (Access):cn.execute "delete * from pp where id="& Text1.Text(sqlServer):cn.execute "delete pp where id="& Text1.Textrs.close if rs.eof=true or rs.bof=true then '表示没有找到elseendif if rs.eof=true or rs.bof=true then '表示没有找到else do while rs if rs.fields("id")="3" then rs.delet rs.update endifendif if rs.eof=true or rs.bof=true then '表示没有找到else do while rs if rs.fields("id")="3" then rs.delet rs.update endif rs.movenext loopendif If rs.RecordCount <> 0 Then MsgBox "找到了" Else MsgBox "数据库错误", vbExclamation, "错误" End If若是找到,则记录个数一定大于0,否则小于0。这可以吗? 同意(olianan)剑琴的跟贴,我也是这么解决的。 一定注意你的数据库链接cnn的游标是否为客户端游标否则,你的当前记录数等问题都会出问题。 @@@@@@@@@@@@@@@ 非VB高手不可的问题:一个VB中嵌入的网页编辑器中有一张本地图片,如何将它用WEB上传到远程? picture控件的问题 什么安装软件可以安装Excel的xla的插件? 请教一下,二种方案哪种可行? 如何通过bas文件使几个页面共享代码? 请问有比DataGrid更好用的控件吗?谢谢 存储过程有疑.....高手请指导 给大家拜年了!!! 高分求:精確比較兩個文件的方法 如何在VB中对文件进行排序等操作??救急 提问: 所谓的注册表垃圾清除是如何做的? 请教各位高手 关于DXF文件问题
....
end if或者
if rs.recordcount=0 then (只法不安全)
Text1.Text=3
rs.Open "select * from pp where id=" & Text1.Text, cn, 1, 1
比如说现在找到了ID=3的记录了,接着如何写。
cn.execute "delete * from pp where id="& Text1.Text
(sqlServer):
cn.execute "delete pp where id="& Text1.Text
rs.close
do while rs
if rs.fields("id")="3" then
rs.delet
rs.update
endif
endif
do while rs
if rs.fields("id")="3" then
rs.delet
rs.update
endif
rs.movenext
loop
endif
MsgBox "找到了"
Else
MsgBox "数据库错误", vbExclamation, "错误"
End If
若是找到,则记录个数一定大于0,否则小于0。这可以吗?