i get an error when I'm trying to display multiple records from a database by selecting from the checkbox.
If Request("Go")="Go" then
i = request.form("item")
strSelection = request.form("opt")
'convert strSelection to String
strSelection = CStr(strSelection)
arrSelection = Split(strSelection, ", ")'return array of sub strings
Dim i, strQuery
strQuery = "Select * from ABSSubGrade WHERE"
For i = 0 to UBOUND(arrSelection)
If i > 0 Then
strQuery = StrQuery & " OR Item = '" & arrSelection(i) & "' ORDER by Item,ABSID"
strQuery = strQuery & " Item = '" & arrSelection(i) & "'"
sql31 = "Select * from ABS order by ABSID"
Set Rs31 = Server.CreateObject("ADODB.RecordSet")
Set Rs32 = Server.CreateObject("ADODB.RecordSet")
This works fine when i select two checkboxes, however when i select more than two, error occurs. please assis me.
i printed my sql statement and this is how it looks:
Select * from ABSSubGrade WHERE Item = 'S501 G10' OR Item = 'S501 G30' ORDER by Item,ABSID OR Item = 'S505 G10' ORDER by Item,ABSID