<% set rs0=Server.CreateObject("ADODB.RECORDSET")
sql=" select * from Plants where CategoryID <> 0"
if Request("CategoryID") <> "-1" and Request("CategoryID") <> "" then sql = sql & " and CategoryID=" & Request("CategoryID")
if request("firstchar") <> "" and request("firstchar") <> "-1" then sql = sql & " and PlantName like'" & Request("firstchar") & "%'"
rs0.Open sql,sdsn,adOpenKeyset,adLockReadOnly,AdCmdText
if not rs0.EOF then %>