如何用DATA实现模糊查询
请各位大哥帮帮忙,帮小弟看一下,如何将下列的语句改为模糊查询!!小弟根据书上的说明将运算符改为LIKE,改了一夜都改不成功!改红色的语句,还用DATA实现。请各位帮帮忙,小弟先在这谢过各位了!!Dim chazhao As String
If Combo2.Text = "姓名" Then
chazhao = InputBox("请输入要查找的姓名", "查找窗")
Data1.Recordset.FindFirst "姓名='" & chazhao & "'"
If Data1.Recordset.NoMatch Then
MsgBox "查无此人!", 64, "提示"
End If
ElseIf Combo2.Text = "性别" Then
chazhao = InputBox("请输入要查找的性别", "查找窗")
Data1.Recordset.FindFirst "性别='" & chazhao & "'"
ElseIf Combo2.Text = "联系电话" Then
chazhao = InputBox("请输入要查找的联系电话", "查找窗")
Data1.Recordset.FindFirst "联系电话='" & chazhao & "'"
If Data1.Recordset.NoMatch Then
MsgBox "查无此电话", 64, "提示"
End If
ElseIf Combo2.Text = "传真" Then
chazhao = InputBox("请输入要查找的传真", "查找窗")
Data1.Recordset.FindFirst "传真='" & chazhao & "'"
If Data1.Recordset.NoMatch Then
MsgBox "查无此传真!", 64, "提示"
End If
ElseIf Combo2.Text = "QQ" Then
chazhao = InputBox("请输入要查找的QQ号码", "查找窗")
Data1.Recordset.FindFirst "QQ='" & chazhao & "'"
If Data1.Recordset.NoMatch Then
MsgBox "查无此QQ号码!", 64, "提示"
End If
ElseIf Combo2.Text = "E-Mial" Then
chazhao = InputBox("请输入要查找的E-Mial地址", "查找窗")
Data1.Recordset.FindFirst "电邮='" & chazhao & "'"
If Data1.Recordset.NoMatch Then
MsgBox "查无此电邮!", 64, "提示"
End If
ElseIf Combo2.Text = "联系地址" Then
chazhao = InputBox("请输入要查找的地址", "查找窗")
Data1.Recordset.FindFirst "联系地址='" & chazhao & "'"
If Data1.Recordset.NoMatch Then
MsgBox "查无此地址!", 64, "提示"
End If
End If