帮忙看看代码,哪里不对。。。
Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
If (Text1.Text = "") Or (Combo1.Text = "") Then
MsgBox "条件不能为空", vbQuestion, "提示信息"
Combo1.SetFocus
Else
Set rs = cnn.Execute("select * from 供货商明细表 where +'" + Trim(Combo1.Text) + "' like + '%' +'" + Trim(Text1.Text) + "'+ '%'")
If rs.RecordCount > 0 Then
MsgBox "找到符合的记录", vbQuestion, "提示信息"
Else
MsgBox "没找到符合的记录", vbQuestion, "提示信息"
End If
rs.Close
End If
End Sub
运行时不报错,但是输入条件后怎么都查询不到记录,库中确实有符合条件的记录。请高手帮帮忙。本人菜鸟,刚长羽毛就碰到难题了,在此拜谢各位大佬!