[求助]代码错误
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="inc/strchk.asp"-->
<%
ttt=rtrim(ltrim(request("ttt")))
search=request("search")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/my.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查找结果</title>
</head>
<body>
<% if search="按标题查找" then
set rst=server.createobject("adodb.recordset")
sqlt="select * from mybook where title like '%strchk("&ttt&")%' order by time desc"
rst.open sqlt,conn,1,1
%>
<table width="722" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="722" height="63" align="center" valign="top"> <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="500" align="center">共搜索到<%=rst.recordcount%>篇文章<font color=#FF0066>标题</font>符合,关键词:<font color=#FF0066><%=ttt%></font></td>
</tr>
</table></br>
<% end if
if search="按姓名查找" then
set rst=server.createobject("adodb.recordset")
sqlt="select * from mybook where name like '%strchk("&ttt&")%' order by time desc"
rst.open sqlt,conn,1,1
%>
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="494" align="center">共搜索到<%=rst.recordcount%>篇文章<font color=#FF0066>姓名</font>符合,关键词:<font color=#FF0066><%=ttt%></font></td>
</tr>
</table></td>
</tr>
<tr>
<td height="310" align="center" valign="top">
<%end if
if rst.eof and rst.bof then%>
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="24" align="center"><%=("没有找到任何结果<a href='javascript:window.close()'>关闭</a>")%></td>
</tr>
</table>
</br>
<%else%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="685" height="280" align="center" valign="top"><table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class=k1>
<tr bgcolor="#FFFFFF" class=k1>
<td height="21" bgcolor="#EDF3FF">作者:
<%if rst("name")<>"" then%>
<%=rst("name")%>
<%else
response.write("匿名")
end if%>
</td>
<td height="21" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rsw("qq")%>"> <a href="">mailt<%=rsw("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rsw("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="161" height="148" valign="top" bgcolor="#EDF3FF"> <%if rst("sex")="male" then%>
<img src="sex/boy.gif" width="23" height="21">
<%else%>
<img src="sex/girl.gif">
<%end if%><br> </br>
<br><img src="image/<%=rst("face")%>"><%=rsw("time")%></td>
<td width="310" valign="top" bgcolor="#EDF3FF" style="table-layout:fixed;word-break:break-all"> </br>
标题:<strong><font color=red><%=rst("title")%></font></strong>
<hr align="left" width=100 size=1px noshade>
</br>
<img src="pic/<%=rst("pic")%>"><%=rst("word")%></td>
</tr>
</table>
<table width="526" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="405" height="54"><p>共<%=rst.pagecount%>页,共有<%=rst.recordcount%>条,你当前在第<%=page%>页,<%=page%>/<%=rst.pagecount%>
<%if page>1 then%>
<a href=searchchk.asp?page=<%=1%> class="v1">[首页]</a>
<%else%>
[首页]
<%end if%>
<%if page>1 then%>
<a href=searchchk.asp?page=<%=page-1%> class="v1">[上一页]</a>
<%else%>
[上一页]
<%end if%>
<% if not rst.eof then%>
<a href=searchchk.asp?page=<%=page+1%> class="v1">[下一页]</a>
<%else%>
[下一页]
<%end if%>
<% if not rst.eof then%>
<a href=searchchk.asp?page=<%=rst.pagecount%> class="v1">[尾页]</a>
<%else%>
[尾页]
<%end if%>
</td>
<td width="118" valign="middle"><form name="form1" method="post" action="rword.asp">
<select name="page" size="1">
<% for i=1 to rst.pagecount%>
<option value="<%=i%>" <% if i=page then%>selected<%end if%>><%=i%></option>
<%next%>
</select>
<input type="submit" name="Submit" value="跳转">
</form></td>
</tr>
</table>
<p> </p></td>
</tr>
</table>
<%end if%></td>
</tr>
<tr>
<td height="132"> </td>
</tr>
</table>
</body>
</html>
技术信息(适用于支持人员)
- 错误类型: Microsoft VBScript 运行时错误 (0x800A01A8) /searchchk.asp, 第 43 行
- 浏览器类型: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) 我找了好久不知道错在哪里,请高手来帮帮我。
[此贴子已经被作者于2005-6-11 17:34:45编辑过]