I am trying to setup a simple search that will search a table in a microsoft database. here is the script i have:
<%
If strSection = "all" OR strSection = "" Then
Response.Write("empty search")
Else
strSQL = "SELECT Beginning, Title, Blurb, Body, Author, Date "
strSQL = strSQL & "FROM " & strSection &" "
strSQL = strSQL & "WHERE (((Body) Like '*" & strSrchStr & "*'));"
'If strSection = "articles" Then
' strSQL = strSQL & "ORDER BY Date;"
'Else
'strSQL = strSQL & "ORDER BY Beginning;"
'End If
rsCommon.open strSQL, adoCon
If rsCommon.EOF Then
Response.Write("Search for <b>" & strSrchStr & "</b> in <b>" & strSection & "</b> had no results.<br>" & strSQL )
Else
Response.Write("<table border=1 cellpadding=2 cellspacing=1>")
Do While NOT rsCommon.EOF
strTitle = rsCommon("Title")
strAuthor = rsCommon("Author")
strBlurb = rsCommon("Blurb")
Response.Write( "<tr><td align=center><font size=4><b>" & strTitle & "</b></font><p></td>")
Response.Write( "<td><i><b>" & strAuthor & "</b></i></td>" )
Response.Write( "<td>" & Replace(strBlurb, vbCrLf, "<br />") & "</td></tr>")
rsCommon.MoveNext
Loop
End If
rsCommon.close
End If
%>
The strSQL works fine, i got it to print out. and everything is read in fine, but the rsCommon is always at EOF. why is it? the page is here:
http://www.gentlefaith.com/search.asp