Private Sub Command3_Click()
Dim sql As String, mlink As String, mpath As String, mzy As String
mpath = App.Path
If Right(mpath, 1) <> "\" Then App.Path = mpath + "\"
mzy = InputBox$("请输入房号", "查找窗")
sql = "Select * from 散客帐务查询 where 房号='" & mzy & "'"
mlink = "Provider=Microsoft.Jet.OLEDB.3.51;"
mlink = mlink + "Persist Security Info=False;"
mlink = mlink + "Data Source=" + App.Path + "客人情况登记.mdb"
Adodc1.ConnectionString = mlink
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "无此人!", , "提示"
End If
End Sub