Im trying to search a simple database of events, giving the user options to filter based on 3 parameters:
1.) a text / keyword string in the DESCRIPTION or NAME of the event
2.) a list menu (database generated) that allows them to select a CITY
3.) a list menu (also database generated) that allows them to choose an event category
It SEEMS to work but I keep finding bugs like it returning ALL when it shouldnt (i.e. City = Mayberry and text string = "music" or something like that.)
What could be the culprit here? I though I might need to add parenthesis around a part of the select statement like I've learned here on tek-tips before, but that doesnt correct the issue...
here is the code DW generated for my select statement:
1.) a text / keyword string in the DESCRIPTION or NAME of the event
2.) a list menu (database generated) that allows them to select a CITY
3.) a list menu (also database generated) that allows them to choose an event category
It SEEMS to work but I keep finding bugs like it returning ALL when it shouldnt (i.e. City = Mayberry and text string = "music" or something like that.)
What could be the culprit here? I though I might need to add parenthesis around a part of the select statement like I've learned here on tek-tips before, but that doesnt correct the issue...
here is the code DW generated for my select statement:
Code:
Set RS_Events = Server.CreateObject("ADODB.Recordset")
RS_Events.ActiveConnection = MM_Events_Conn_STRING
RS_Events.Source = "SELECT * FROM tbl_events WHERE EventTitle Like '%" + Replace(RS_Events__MMColparam1, "'", "''") + "%' Or EventDetail Like '%" + Replace(RS_Events__MMColparam1, "'", "''") + "%' And City = '" + Replace(RS_Events__MMColParam2, "'", "''") + "' And EventCategory Like '%" + Replace(RS_Events__MMColParam3, "'", "''") + "%'"