以下是引用meihonganddulon在2008-12-3 08:20的发言:
贴出来SQL语句
Dim sql As String
Dim rs_find As New ADODB.Recordset
Dim conn As String
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=gongyu.mdb;Persist Security Info=False"
sql = "select * from 公寓信息 where 楼号='" & Combo1.Text & "'
and
房间号='" & Text1.Text & "'
"
DataGrid1.AllowUpdate = True
rs_find.CursorLocation = adUseClient
rs_find.Open sql, conn, adOpenKeyset, adLockPessimistic
DataGrid1.AllowUpdate = False
If rs_find.EOF Then
MsgBox "对不起!没有您要查找的记录", vbOKOnly + vbExclamation, "失败"
Exit Sub
End If
Set DataGrid1.DataSource = rs_find