Home > Software engineering >  Change how could a little fuzzy query, please help
Change how could a little fuzzy query, please help

Time:10-09

Private Sub Command9_Click (Index As an Integer)

If Combo1="" Then
MsgBox "condition can't be empty, please choose a condition", vbExclamation, "query"
Combo1. SetFocus
The Exit Sub
The Else
If Text1="" Then
MsgBox "conditional value can't be empty, please input... "VbExclamation," query "
Text1. SetFocus
The Exit Sub
End the If
End the If

Cn. The Open ". The provider=Microsoft jet. The OLEDB. 4.0; Data source="& amp; App. The Path & amp; "\ Data. MDB"

Sq="table where the select * from POS information & amp; Combo1. Text & amp; "='" & amp; Text1 & amp; "'
"Rs. The Open sq, Cn, adOpenKeyset, adLockOptimistic

Form1. ListView1. ListItems. Clear 'first to empty the data in the form
'empty _Click
If the rs. RecordCount=0 Then
MsgBox "no eligible data", vbExclamation, "query"
Text1. SetFocus
On Error GoTo 100
The Else
For I=1 To rs. RecordCount
Set Fliv=Form1. ListView1. ListItems. The Add ()

Fliv. Text=rs. Fields (" product ")
Fliv. SubItems (1)=rs. Fields (" product size ")
Fliv. SubItems (2)=rs. Fields (" products ")


'we can add to query cases


Rs. MoveNext
Next I
End the If
100:
Rs. Close
Cn. Close
Set the rs=Nothing
The Set Cn=Nothing
End Sub

CodePudding user response:

Sq="table where the select * from POS information & amp; Combo1. Text & amp; "Like '%" & amp; Text1 & amp; "% '"

CodePudding user response:

* corresponding %
? Corresponding _
With the Like
  • Related