Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox ("帐号~~~密码~~~取款额~~~都不能为空")
Text1.SetFocus
Else
If Not IsNumeric(Text1.Text) Then
MsgBox ("帐号必须为数字~~~~~~")
Text1.Text = ""
Text1.SetFocus
Else
If Not IsNumeric(Text3.Text) Or Val(Text3.Text) <= 0 Then
MsgBox ("取款额必须为大于 0 的正数~~~~~~")
Text3.Text = ""
Text3.SetFocus
Else
db_link
rs.Open "开户信息表", conn, adOpenDynamic, adLockBatchOptimistic
rs.Find "帐号='" & Text1.Text & " '"
If rs.EOF Then
db_close
MsgBox ("无此帐号,请重新输入`````")
'rs.MoveFirst
Text1.Text = ""
Text1.SetFocus
Else
'定位 到 帐号后 怎么在 datagrid1 “数据控件”里
'显示该 记录的其它 字段``?
End If End If End If
End If
End Sub
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox ("帐号~~~密码~~~取款额~~~都不能为空")
Text1.SetFocus
Else
If Not IsNumeric(Text1.Text) Then
MsgBox ("帐号必须为数字~~~~~~")
Text1.Text = ""
Text1.SetFocus
Else
If Not IsNumeric(Text3.Text) Or Val(Text3.Text) <= 0 Then
MsgBox ("取款额必须为大于 0 的正数~~~~~~")
Text3.Text = ""
Text3.SetFocus
Else
db_link
rs.Open "开户信息表", conn, adOpenDynamic, adLockBatchOptimistic
rs.Find "帐号='" & Text1.Text & " '"
If rs.EOF Then
db_close
MsgBox ("无此帐号,请重新输入`````")
'rs.MoveFirst
Text1.Text = ""
Text1.SetFocus
Else
'定位 到 帐号后 怎么在 datagrid1 “数据控件”里
'显示该 记录的其它 字段``?
End If End If End If
End If
End Sub
解决方案 »
- 关于msgbox的小问题
- 只向前游标与可以前后移动的游标有何区别呀,在使用中本质不同是什么,谁能给个例子?
- vb与SQL连接问题
- 我的程序老会出现这样的错误
- 怎样用鼠标点击按钮来实现的vb中webbrowser页面的滚动
- 如何才能找到这个API涵数的声明?(function InternetReadHTML Lib "Wininet.dll")
- 我把我所有的分数都给你们!请高手们再帮帮我!
- 哪里有Visual Basic5.0下载?
- 如何修改菜单编辑器中字体的显示
- 一个不知道可不可以实现的问题,欢迎大家来讨论(关于建立虚拟桌面)。有提供方案者可另送分
- 达人,求助!!!
- 同一个rs记录集,为什么一台电脑就有数据方法FindFirst,一台就没有?急求原因和解决办法!
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox "帐号~~~密码~~~取款额~~~都不能为空"
Text1.SetFocus
Exit Sub
End IfIf Not IsNumeric(Text1.Text) Then
MsgBox ("帐号必须为数字~~~~~~")
Text1.Text = ""
Text1.SetFocus
Exit Sub
End IfIf Not IsNumeric(Text3.Text) Or Val(Text3.Text) <= 0 Then
MsgBox ("取款额必须为大于 0 的正数~~~~~~")
Text3.Text = ""
Text3.SetFocus
Exit Sub
End If
db_link
rs.Open "开户信息表", conn, adOpenDynamic, adLockBatchOptimistic
rs.Find "帐号='" & Text1.Text & "'"
If rs.EOF Then
db_close
MsgBox ("无此帐号,请重新输入`````")
'rs.MoveFirst
Text1.Text = ""
Text1.SetFocus
Else
'定位 到 帐号后 怎么在 datagrid1 “数据控件”里
'显示该 记录的其它 字段``?
set datagrid1.datasource = rs
End IfEnd Sub
1 20。0 2121
2 30。9 32123我只想在 datagrid1 里显示
帐号 身份证号
2 32123这一条记录```怎么办``
rs.open "select * from 开户信息表 where 帐户='" & text1.text & "'",conn,adOpenDynamic, adLockBatchOptimisticif rs.eof thenelse
set datagrid1.datasource = rs
datagrid1.refresh
endif
rs.close
set rs=nothing
这两句 ,程序提示
对象打开时,操作不被允许
但是加上后,datagrid1 又不显示了```该怎么办`???
还是那一句错``标准表达式中数据类型不匹配``````````rs.Open "select * from 开户信息表 where 帐号='" & Text1.Text & "'", conn, adOpenDynamic, adLockBatchOptimistic