Cinnamon
03-06-2002, 11:38 AM
Ok... you knew I'd be back with another problem. Now that I'm in the testing phase. The error messages are working and ONE WORD searches are perfect. That brings me to a the problem.
I clicked the SEARCH command button and typed in "abandoned" and got the 10 records I expected. The ENTRY field of the records contains the text "abandoned iron mines of Chester Borough". However... when I click on the SEARCH command button and type in "abandoned mines" I get NO MATCHES. I was hoping to get the same 10 as before.
Scratching my head and looking confused.... what do I do to fix this?
Private Sub Command6_Click()
Dim sSQL As String
Dim INQUIRE As String
Dim Count As Integer
On Error GoTo ErrLabel:
INQUIRE = InputBox("Enter search criteria (leave blank for all):")
sSQL = "SELECT * FROM cards WHERE entry LIKE '%" & INQUIRE & "%'"
Set rsDB = New ADODB.Recordset
If INQUIRE = "" Then
rsDB.Open "SELECT * FROM Cards", cnDB, adOpenKeyset, adLockOptimistic, adCmdText
Else
rsDB.Open sSQL, cnDB, adOpenKeyset, adLockOptimistic, adCmdText
End If
Set MSHFG1.DataSource = rsDB
Count = rsDB.RecordCount
rsDB.MoveFirst
Image1.Picture = LoadPicture(rsDB.Fields("CardPath"))
Form1.Text1.Text = rsDB.Fields("Unique#")
Form1.Text2.Text = rsDB.Fields("CardNum")
Form1.Text3.Text = rsDB.Fields("CardPath")
Form1.Text4.Text = rsDB.Fields("Entry") & ""
Form1.Text5.Text = Count
Exit Sub
ErrLabel:
MsgBox ("There are no matches to your inquiry.")
End Sub
Cinnamon
I clicked the SEARCH command button and typed in "abandoned" and got the 10 records I expected. The ENTRY field of the records contains the text "abandoned iron mines of Chester Borough". However... when I click on the SEARCH command button and type in "abandoned mines" I get NO MATCHES. I was hoping to get the same 10 as before.
Scratching my head and looking confused.... what do I do to fix this?
Private Sub Command6_Click()
Dim sSQL As String
Dim INQUIRE As String
Dim Count As Integer
On Error GoTo ErrLabel:
INQUIRE = InputBox("Enter search criteria (leave blank for all):")
sSQL = "SELECT * FROM cards WHERE entry LIKE '%" & INQUIRE & "%'"
Set rsDB = New ADODB.Recordset
If INQUIRE = "" Then
rsDB.Open "SELECT * FROM Cards", cnDB, adOpenKeyset, adLockOptimistic, adCmdText
Else
rsDB.Open sSQL, cnDB, adOpenKeyset, adLockOptimistic, adCmdText
End If
Set MSHFG1.DataSource = rsDB
Count = rsDB.RecordCount
rsDB.MoveFirst
Image1.Picture = LoadPicture(rsDB.Fields("CardPath"))
Form1.Text1.Text = rsDB.Fields("Unique#")
Form1.Text2.Text = rsDB.Fields("CardNum")
Form1.Text3.Text = rsDB.Fields("CardPath")
Form1.Text4.Text = rsDB.Fields("Entry") & ""
Form1.Text5.Text = Count
Exit Sub
ErrLabel:
MsgBox ("There are no matches to your inquiry.")
End Sub
Cinnamon