28,390
社区成员
发帖
与我相关
我的任务
分享
错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'type='' and checkstate=' 中。
/admin/vip_show.asp, 第 28 行
<!--#include file="../Data/conn.asp" -->
<!--#include file="../Include/function.asp"-->
<%
response.charset = "GBK"
if session("Admin") = "" then
call ShowMsg("非法登录","admin_login.asp")
end if
dim rs,sql,title,state1,type1
state1=request.form("payfor") '获取管理员选择的付费状态(0、1、all)
type1=request.form("select") '获取管理员选择的信息类别
if(type1="") then '如果类型为空
state1=request.form("state1") '获取付费状态
type1=request.form("type1") '获取付费类型
end if
set rs = server.createobject("adodb.recordset")
if(state1="all") then '付费状态为“全部”,则查询指定信息类别下的所有付费信息,并按id降序排列
sql="select * from VipInfo where type='"&type1&"' order by id desc"
else '付费状态为“已付费”或是“为付费”,则按指定的条件进行查询,并按id降序排列
sql="select * from VipInfo where type='"&type1&"' and checkstate="&state1&" order by id desc"
'response.write sql[select * from VipInfo where type='招聘信息' and checkstate=0 order by id desc]
'response.end
end if
rs.open sql,conn,1,1
'分页模块
dim i,page
rs.pagesize = 5 '设置每页多少条
allpage = rs.pagecount '总页数
allcount = rs.recordcount '总条数
page = request.querystring("page") '接收传过来的page页码
'一开始,进入列表页,没有传page值,那么page就是空置,所以可以设置为第一页1
if page = "" then page = 1
'判断如果不是数字,那么page = 1
if isnumeric(page) then
'如果是0或者负数,那么page还是1 cint是整型,clng是长整形
if clng(page) <1 then page = 1
'如果page大于最大的分页数,那么就是最后一页
if clng(page) > rs.pagecount then page = rs.pagecount
else
page = 1
end if
'当前页码
if not rs.eof then
rs.absolutepage = page
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>菲戈--后台管理</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<h1><%response.Write(type1)%></h1>
<table width="709" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFCC33">
<tr align="center" bgcolor="#FFCC33">
<td width="76">信息标题</td>
<td width="204">信息内容</td>
<td width="65">联系人</td>
<td width="88">联系电话</td>
<td width="79">发布日期</td>
<td width="72">截止日期</td>
<td width="54">审核状态</td>
<td width="62">操作</td>
</tr>
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
if(rs("checkstate")=1)then
state2="已付费"
else
state2="未付费"
end if
%>
<tr align="center" bgcolor="#FFFFFF">
<td><% =rs("title")%></td>
<td><% =rs("content")%></td>
<td><% =rs("linkman")%></td>
<td><% =rs("tel")%></td>
<td><% =rs("sdate")%></td>
<td><% =rs("showday")%></td>
<td><% response.write(state2)%></td>
<td>
<a href="vip_show.asp">审核</a>/
<a href="vip_show.asp?del=ok&ShowId=<%=rs("id")%>">删除</a>
</td>
</tr>
<%
rs.movenext
next
%>
<tr align="center" bgcolor="#FFFFDD">
<td height="22" colspan="8">
<p style="text-align:center;text-indent:40px;">
<%if allpage > 0 then%>
当前页<%=page%>/<%=allpage%> | 每页<%=rs.pagesize%>条
<%else%>
当前页0/0
<%end if%>
<a href="vip_show.asp?page=1&type1=<% response.Write(type1)%>&state1=<% response.Write(state1)%>">首页</a> |
<%if page<>1 then%>
<a href="vip_show.asp?page=<%=page-1%>&type1=<% response.Write(type1)%>&state1=<% response.Write(state1)%>">上页</a> | <%end if%>
<%if page<>allpage then%>
<a href="vip_show.asp?page=<%=page+1%>&type1=<% response.Write(type1)%>&state1=<% response.Write(state1)%>">下页</a> | <%end if%>
<a href="vip_show.asp?page=<%=allpage%>&type1=<% response.Write(type1)%>&state1=<% response.Write(state1)%>">尾页</a> | 转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to allpage
if i = page then%>
<option value="vip_show.asp?page=<%=i%>&type1=<% response.Write(type1)%>&state1=<% response.Write(state1)%>" selected><%=i%></option>
<%else%>
<option value="vip_show.asp?page=<%=i%>&type1=<% response.Write(type1)%>&state1=<% response.Write(state1)%>"><%=i%></option>
<%
end if
next
%></select>页</font>
</p>
</td>
</tr>
</table>
</body>
</html>
<%
call close_rs
call close_conn
%>
<h2>■付费信息显示方式</h2>
<form name="form4" method="post" action="vip_show.asp">
<fieldset style="height:60;width:210">
<legend>★ 付费状态</legend>
<input name="payfor" type="radio" value="1">已付费
<input name="payfor" type="radio" value="0" checked>未付费
<input name="payfor" type="radio" value="all">全部
</fieldset>
信息类别:
<select name="select">
<option value="招聘信息" selected>-招聘信息</option>
<option value="求职信息">-求职信息</option>
<option value="培训信息">-培训信息</option>
<option value="家教信息">-家教信息</option>
<option value="房屋信息">-房屋信息</option>
<option value="车辆信息">-车辆信息</option>
<option value="求购信息">-求购信息</option>
<option value="出售信息">-出售信息</option>
<option value="招商引资">-招商引资</option>
<option value="公寓信息">-公寓信息</option>
<option value="寻人/物启示">-寻人/物启示</option>
</select>
<input type="submit" name="Submit2" value="检索">
</form>
response.write("type1="&type1)
response.write("checkstate="&state1)
显示type1=招聘信息checkstate=0