#12005/11/2 13:24:27
错误提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft JET Database Engine 错误 '80040e14'
语法错误 (操作符丢失) 在查询表达式 'SMT_id=' 中。
/www/admin/sca/sca.asp,行126
==========================
第124-126行为
================
set rs1=Server.CreateObject("Adodb.Recordset")
sql1="select * from SMT_scasort where SMT_id="&rs("SMT_scasort")
rs1.open sql1,conn,1,1
===================
原文代码:
<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla3<>1 then
response.write "<script>alert('操作权限出错,您没有权限操作些功能');history.go(-1);</Script>"
Response.End
end if%>
<%if request("action")="del" then
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
conn.execute("delete from SMT_sca where SMT_id="&id(i)&"")
conn.execute("delete from SMT_bookcp where SMT_adcp=0 and SMT_book_id="&id(i)&"")
next
end if
%>
<%=citycss%>
<script>
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
<script>
function oa_tool1(){
window.parent.mm.rows="200,10,*";
}
</script>
<body style="margin:10">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="form1" method="post" action="sca.asp">
<tr align=center bgcolor=#efefef><td height=25 align=center><input type="text" name="word"> <input type="submit" name="Submit" value="商机搜索"> <a href="sca.asp?cha=yes">10天内到期</a> <a href="sca.asp?key2=0">已关闭</a> <a href="sca.asp?zc=yes" class=red>正常商机</a> <a href="sca.asp?key1=0">待审</a> <a href="sca.asp?key1=1">已审</a> <a href="sca.asp?last=yes">到期</a> <a href="sca.asp?key3=1">正常推荐</a> <a href="sca.asp">所有</a></td></tr>
</form>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr><td height=25> <a href="sca.asp">所有</a> <a href=sca.asp?scasort=0>不分类</a>
<%set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_scasort order by SMT_date desc"
rs.open sql,conn,1,1
do while not rs.eof%>
<a href=sca.asp?scasort=<%=rs("SMT_id")%>><%=rs("SMT_scasort")%></a>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</td></tr>
</table>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="from1" method="post" action="sca.asp?action=del">
<tr align=center bgcolor=#efefef>
<%set rs=server.createobject("adodb.recordset")
if request("word")<>"" then
sql= "select * from SMT_sca where (SMT_scatitle like'%"&request("word")&"%' or SMT_sca like'%"&request("word")&"%') and SMT_key1=1 order by SMT_id desc"
elseif request("cha")<>"" then
sql="select * from SMT_sca where SMT_key1=1 and SMT_lastdate<("&SMT_citydate&"+10) and (SMT_lastdate-"&SMT_citydate&")>0 order by SMT_id desc"
elseif request("key2")<>"" then
sql="select * from SMT_sca where SMT_key1=1 and SMT_key2=0 order by SMT_id desc"
elseif request("key1")<>"" then
sql="select * from SMT_sca where SMT_key1="&request("key1")&" order by SMT_id desc"
elseif request("key3")<>"" then
sql="select * from SMT_sca where SMT_key1=1 and SMT_key3="&request("key3")&" and (SMT_lastdate-"&SMT_citydate&")>0 order by SMT_tjdate desc"
elseif request("last")<>"" then
sql="select * from SMT_sca where (SMT_lastdate-"&SMT_citydate&")<0 order by SMT_id desc"
elseif request("zc")<>"" then
sql="select * from SMT_sca where (SMT_lastdate-"&SMT_citydate&")>0 and SMT_key1=1 and SMT_key=1 and SMT_key2=1 order by SMT_id desc"
elseif request("scasort")<>"" then
sql="select * from SMT_sca where SMT_scasort="&request("scasort")&" order by SMT_id desc"
else
sql="select * from SMT_sca order by SMT_id desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "暂无内容"
else
'分页的实现
listnum=22
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
<td width="4%" height=20>编号</td>
<td width=*>商机名称<font color=red>(点击查看)</font></td>
<td width="6%">添加</td>
<td width="6%">点击</td>
<td width="8%">发布时间</td>
<td width="8%">到期时间</td>
<td width="10%">有效期</td>
<td width="5%">状态</td>
<td width="5%">操作</td>
<td width="5%">修改</td>
<td width="5%">选择</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1
begindate=cdate(year(rs("SMT_begindate"))&"-"&month(rs("SMT_begindate"))&"-"&day(rs("SMT_begindate")))
lastdate=cdate(year(rs("SMT_lastdate"))&"-"&month(rs("SMT_lastdate"))&"-"&day(rs("SMT_lastdate")))
tian=lastdate-date()
ztian=lastdate-begindate
if ztian=0 then
aaa="长期"
else
aaa="<font color=red>"&tian&"</font>/"&ztian&" 天"
end if
set rs1=Server.CreateObject("Adodb.Recordset")
sql1="select * from SMT_scasort where SMT_id="&rs("SMT_scasort")
rs1.open sql1,conn,1,1
if not rs1.eof then
scasort="<strong><font color=green>["& rs1("SMT_scasort") &"]</font></strong> "
end if
rs1.close
set rs1=nothing%>
<tr align=center height=22>
<td><%=n%></td>
<td align=left> <%=scasort%><a href=# onClick="javascript:window.open('sca_view.asp?id=<%=rs("SMT_id")%>','_blank','width=780,height=400,scrollbars=yes')"><%=rs("SMT_scatitle")%></a><%if rs("SMT_key3")=1 then%> <font color=red>[推荐]</font><%end if%><%if rs("SMT_key1")=0 then%> <font color=green>[待审]</font><%end if%></td>
<td><%if rs("SMT_enrol")=0 then%><font color=red>企业</font><%elseif rs("SMT_enrol")=1 then%><font color=blue>代理</font><%elseif rs("SMT_enrol")=2 then%>后台<%elseif rs("SMT_enrol")=3 then%><font color=#999999>免费</font><%end if%></td>
<td><%=rs("SMT_htc")%></td>
<td><%=begindate%></td>
<td><%=lastdate%></td>
<td><strong><%=aaa%></strong></td>
<td><%if rs("SMT_key2")=1 then%>开通<%else%><font color=red>关闭</font><%end if%></td>
<td><a href=lx.asp?id=<%=rs("SMT_id")%> onClick="oa_tool1()" target=top>操作</a></td>
<td><a href=sca_edit.asp?id=<%=rs("SMT_id")%>>修改</a></td>
<td><input type="checkbox" name="ID" value="<%=rs("SMT_id")%>" style="border:0"></td>
</tr>
<%rs.movenext
i=i+1
j=j-1
loop%>
<tr>
<%filename="sca.asp?word="&request("word")&"&cha="&request("cha")&"&key1="&request("key1")&"&key2="&request("key2")&"&key3="&request("key3")&"&last="&request("last")&"&zc="&request("zc")&"&scasort="&request("scasort")&""%>
<%response.write "<form method=post action="&filename&">"%>
<td colspan=11 align=right bgcolor=#cccccc><%=Rs.recordcount%> 条商机 <%=listnum%> 条商机/页 共 <%=Rs.pagecount%> 页
<% if page=1 then %>
<%else%>
<a href=<%=filename%>><strong>|<<</strong></a>
<a href=<%=filename%>&page=<%=page-1%>><strong><<</strong></a>
<a href=<%=filename%>&page=<%=page-1%>><b>[<%=page-1%>]</b></a>
<%end if%><% if Rs.pagecount=1 then %><%else%><b>[<%=page%>]</b><%end if%>
<% if Rs.pagecount-page <> 0 then %>
<a href=<%=filename%>&page=<%=page+1%>><b>[<%=page+1%>]</b></a>
<a href=<%=filename%>&page=<%=page+1%>><strong>>></strong></a>
<a href=<%=filename%>&page=<%=Rs.pagecount%>><strong>>>|</strong></a>
<%end if%> <input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0">全选 <input type="submit" name="Submit" value="删 除"> </td>
<%end if%></tr>
</form>
</table>
编辑历史:[此帖最近一次被 putao2006 编辑过(编辑时间:2005-11-02 14:10:21)]