Set rs = Server.CreateObject("ADODB.RecordSet")
sql1 = "SELECT * FROM JGJYJL"
sql3 = " ORDER BY lrrq desc"
If txtKeyd <> "" And Not IsNull(txtKeyd) Then 
  sql2 = " where ccbh LIKE '%"&txtKeyd&"%' OR gg LIKE '%"&txtKeyd&"%' "
else
sql2=""
end if
sql = sql1 & sql3
rs.open sql,cnn,1,3