vb查询 急急急!!!

来源:百度知道 编辑:UC知道 时间:2024/05/22 10:57:02
Call openconn
sqlstr = "select name from books"
Call rs(sqlstr)
If txtname.Text = "" Then
MsgBox "请输入图书名称!"
End If
If txtname.Text = Name then
'这个判断对话框里的书名和数据库中的name中是否相同 相同输入有此图书
应该怎么写

Else
MsgBox "没有此图书!"
Call closeconn
End If

Adodc1.RecordSource = "select * from 人员表 where 姓名='" & kk & " '"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
ans = MsgBox("没有记录,请重新输入!", vbOKOnly + vbExclamation, "人员查询")
Text1.SetFocus

这个就是查询语句。自己改下吧。
不过我看楼主的语句错误很多昂。。。。

dim str as string
str=rs.files("name")
if txtname.text=str then
end