Guys, please help a beginner! I can't find where I'm going wrong. I have the following dropdown box:
<select name="mLast" size="1" tabindex="8">
<option selected>Any Speaker</option>
<%=SF_GetSpeakerSELECT(Request.Form("mLast"))%>
</select>
This is populated by the following code:
<%Function SF_GetSpeakerSELECT(ByVal intCurrentSpeaker)
Dim rsData, strHTML, strSQL
strHTML = ""
If (intCurrentSpeaker <> "") AND IsNumeric(intCurrentSpeaker) Then
intCurrentSpeaker = cInt(intCurrentSpeaker)
End If
strSQL = "SELECT DISTINCT mLast From shiur"
Call DAL_GetRS(strSQL, rsData)
If Not (rsData is Nothing) Then
If rsData.State=1 Then
rsData.MoveFirst
While NOT rsData.EOF
strHTML = strHTML & "<OPTION>" & rsData("mLast") & "</OPTION>"
rsData.MoveNext
Wend
End If
End If
If strHTML = "" Then
strHTML = "<OPTION>Unavailable</OPTION>"
End If
SF_GetSpeakerSELECT = strHTML
SET rsData = Nothing
End Function
%>
However, I get an error when performing the following SQL search:
<%
If Request.Form(mLast) <> "Any Speaker" Then
strSQL = strSQL & " AND mLast = "& Request.Form("mLast")
End If
%>
The error message reads:
Expecting string input
/search.asp, line 254
The function expects a string as input.
<select name="mLast" size="1" tabindex="8">
<option selected>Any Speaker</option>
<%=SF_GetSpeakerSELECT(Request.Form("mLast"))%>
</select>
This is populated by the following code:
<%Function SF_GetSpeakerSELECT(ByVal intCurrentSpeaker)
Dim rsData, strHTML, strSQL
strHTML = ""
If (intCurrentSpeaker <> "") AND IsNumeric(intCurrentSpeaker) Then
intCurrentSpeaker = cInt(intCurrentSpeaker)
End If
strSQL = "SELECT DISTINCT mLast From shiur"
Call DAL_GetRS(strSQL, rsData)
If Not (rsData is Nothing) Then
If rsData.State=1 Then
rsData.MoveFirst
While NOT rsData.EOF
strHTML = strHTML & "<OPTION>" & rsData("mLast") & "</OPTION>"
rsData.MoveNext
Wend
End If
End If
If strHTML = "" Then
strHTML = "<OPTION>Unavailable</OPTION>"
End If
SF_GetSpeakerSELECT = strHTML
SET rsData = Nothing
End Function
%>
However, I get an error when performing the following SQL search:
<%
If Request.Form(mLast) <> "Any Speaker" Then
strSQL = strSQL & " AND mLast = "& Request.Form("mLast")
End If
%>
The error message reads:
Expecting string input
/search.asp, line 254
The function expects a string as input.