<% action=request("action") if action<>"" then snr=request("snr") stype=request("stype") Set Rs=conn.execute( "Select * From [liuyan] where "&stype&" like '%"&snr&"%' Order BY id DESC ") if rs.bof and rs.eof then response.write "<tr><td align='center'>没有找到你所查询的内容</tr></td>" end if else Set Rs = Server.CreateObject("ADODB.Recordset") Sql = "Select * From [liuyan] Order BY id DESC " Rs.Open Sql,conn,1,1 end if %> 这里判断数据库记录为空是这样的吗?
以下是引用就这样子在2005-6-3 16:53:38的发言: <% action=request("action") if action<>"" then snr=request("snr") stype=request("stype") Set Rs=conn.execute( "Select * From [liuyan] where "&stype&" like '%"&snr&"%' Order BY id DESC ") if rs.bof and rs.eof then response.write "<tr><td align='center'>没有找到你所查询的内容</tr></td>" end if '去掉 else Set Rs = Server.CreateObject("ADODB.Recordset") Sql = "Select * From [liuyan] Order BY id DESC " Rs.Open Sql,conn,1,1 end if %> 这里判断数据库记录为空是这样的吗?
这里判断数据库记录为空是这样的
<% action=request("action") if action<>"" then snr=request("snr") stype=request("stype") Set Rs=conn.execute( "Select * From [liuyan] where "&stype&" like '%"&snr&"%' Order BY id DESC ") if rs.bof or rs.eof then response.write "<tr><td align='center'>没有找到你所查询的内容</tr></td>" end if else Set Rs = Server.CreateObject("ADODB.Recordset") Sql = "Select * From [liuyan] Order BY id DESC " Rs.Open Sql,conn,1,1 end if %>