站内搜索问题
<!--#include file="Conn1.asp" --><!--#include file="Include/check.asp"-->
<link href="other/Admin.css" rel="stylesheet" type="text/css">
<%
text=request.Form("text")
session("text")=text
Dim RecordCount
On Error Resume Next
Set rsSearch=Server.CreateObject("ADODB.RecordSet")
IF Request("text")<>"" Then
SQLStr="select * From JaAdmin where JaAdmin like '"&text&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from JaAdmin where JaAdmin='"&text&"'",conn1,1,1
%>
<table width="800" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td colspan="6" bgcolor="#FFFFFF">搜索结果</td>
</tr>
<tr>
<td width="246" bgcolor="#eeeeee"><div align="center">用户名</div></td>
<td width="246" bgcolor="#eeeeee"><div align="center">E-mail</div></td>
<td width="164" bgcolor="#eeeeee"><div align="center">注册类型</div></td>
<td width="164" bgcolor="#eeeeee"><div align="center">注册时间</div></td>
<td width="164" bgcolor="#eeeeee"><div align="center">是否推荐</div></td>
<td width="247" bgcolor="#eeeeee"><div align="center">操作</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("JaAdmin")%> <%response.write session("text")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("UserEmail")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("Userweb")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("JaDate")%></div></td>
<td bgcolor="#FFFFFF"><div align="center">
<%
if Cint(rs("tj"))=0 then
response.write"未推荐"
else
response.write"<font color=ff0000>"
response.write"已推荐"
response.write"</font>"
end if
%>
</div></td>
<td bgcolor="#FFFFFF"><div align="center"><a href="tj.asp?UserID=<%response.write rs("UserID") %>"onClick="{if(confirm('您确定要推荐该记录吗?')){return true;}return false;}">推荐</a>/<a href="qtj.asp?UserID=<%response.write rs("UserID") %>"onClick="{if(confirm('您确定要推荐该记录吗?')){return true;}return false;}">取消推荐</a>
</div></td>
</tr></table>
<%
end if
rsSearch.Close
conn1.close
Set rsSearch=Nothing
Set con=Nothing
%>
已经能实现搜索功能
但是如何判断 数据库里 没有的数据?