标题:VB+access,在查找后得到的数据,如何删除?每次都是删除了第一条
取消只看楼主
jamesh
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2004-11-13
 问题点数:0 回复次数:0 
VB+access,在查找后得到的数据,如何删除?每次都是删除了第一条
VB+access,在查找后得到的数据,如何删除?每次都是删除了第一条
我的查找程序: Private Sub find_Click() Dim rs As ADODB.Recordset If Text1.Text Like "[A-Z]####" <> True Then Text1.SetFocus Text1.Text = "" Exit Sub End If openDB Set rs = New ADODB.Recordset rs.Open "select * from jbinfo where ygbh='" & Text1.Text & " ' ", mydb1, adOpenKeyset, adLockPessimistic ' rs.find "select * from jbinfo where ygbh='" & Text1.Text & " ' ", mydb1, adSearchBackward If rs.EOF And rs.BOF Then Text1.SetFocus Text1.Text = "" MsgBox "该员工编号不存在,请重新输入!", vbOKOnly + vbExclamation, "警告" Exit Sub End If ygxm.Text = rs!ygxm ygbh.Text = rs!ygbh bm.Text = rs!bm xb.Text = rs!xb csny.Text = rs!csny jg.Text = rs!jg cjgz.Text = rs!cjgz jrgs.Text = rs!jrgs byxx.Text = rs!byxx xl.Text = rs!xl zy.Text = rs!zy bz.Text = rs!bz cmddel.Enabled = True cmddel.SetFocus End Sub
我的删除程序: Private Sub cmddel_Click() Dim response As Integer response = MsgBox("确定要修改这条记录?", vbYesNo, "警告") If response = vbNo Then Exit Sub With rs .Delete .MovePrevious If .EOF Then .MoveLast If .BOF Then .MoveFirst mydb1.Close End With display find.SetFocus Text1.Text = "" End Sub
搜索更多相关主题的帖子: access 数据 TABLE 
2004-11-13 04:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-7567-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.088886 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved