% strContains=request.form("contains") Tbl=request.form("tbl") Select Case Tbl Case "Species" VisTableName = Tbl AtrList = "id, fmt, seq" OrderBy = "ORDER BY seq" Case "Genus" VisTableName = "Genera" AtrList = "id, fmt" OrderBy = "ORDER BY seq" Case "Ref" VisTableName = "References" AtrList = "id, PubDate, txtAuth, fmtAuth, fmtRef" OrderBy = "ORDER BY txtAuth, PubDate" End Select %>
user entered logical operators
" & vbcr) ElseIf instr(2, strContains, " ") > 0 then strContains = replace(strContains, " ", " and ") End If ' initialize the recordset object (need to set MaxRecords before query) set rsFishCat = Server.CreateObject("adodb.recordset") '************************************************************ '************* THE SELECT COMMAND *********************** sql_cmd = "SELECT " & AtrList & _ " FROM " & Tbl & _ " WHERE CONTAINS (*, ' " & strContains & " ') " & _ OrderBy '************************************************************ %>| California Academy of Sciences » Research » Ichthyology » Catalog of Fishes |
SEARCH RESULTS FROM THE |
|
<% if (strContains <> "") then ' Response.Write " Form parsed, sql constructed. " & vbCRLF & vbCRLF response.write VisTableName & " that contain: " & strContains & " " MakeDBconnection dbCnxn,rsFishCat,"CoFWeb" rsFishCat.Open sql_cmd, dbCnxn, 3 ' 3 specifies a Static cursor for the recordset ' Response.Write "record set opened by sql_cmd over connection. " & vbCRLF & vbCRLF iRowCnt = rsFishCat.RecordCount Call LogHits ("CoF", (Tbl & ": " & strContains), iRowCnt) ' Response.Write "Hits logged. " & vbCRLF & vbCRLF %> [ <%=iRowCnt %> ] records<% if Not Tbl = "Ref" Then Response.Write(" " & vbCR) DO UNTIL rsFishCat.eof Response.Write " " & rsFishCat("fmt") & " " & vbCRLF & vbCRLF rsFishCat.movenext LOOP Response.Write(vbCR) Else DO UNTIL rsFishCat.eof %>
Please enter a search term. " end if %> |