我想加个审核功能,但总是出错,请大家看看错在那里?

cchendong 2006-04-16 07:37:06
提交后显现“HTTP 500 - 内部服务器错误”,如果不2ssh.asp中不定义IP的条件就会把所有的记录都审核通过,加上IP条后又出错,大家救救我呀,我是菜鸟啊,现在都急死了。
我把代码贴在下面,请大家帮忙分析一下。
<table width="100%" border="1" cellpadding="1" cellspacing="1">
<tr>
<th width="6%" scope="col">序号</th>
<th width="37%" scope="col">品牌车型</th>
<th width="11%" scope="col">行驶路程</th>
<th width="11%" scope="col">出售价</th>
<th width="15%" scope="col">发布时间</th>
<th width="6%" scope="col">详情</th>
<th width="7%" scope="col">审核</th>
</tr>

<%
dim exec,conn
set conn=server.createobject("adodb.connection")
conn.open "driver={SQL Server};server=127.0.0.1;UID=useruser1982;PWd=user19821982;Database=comcq"
set rs = server.createobject("adodb.recordset")
rs.Open "SELECT * FROM escar where re=0 order by id desc", conn,1,1
if rs.eof then
response.write"<tr><td bgcolor=#eeeeee><font color=red size=+1>对不起,暂无记录</font></td></tr>"
else
pages = request.querystring("pages")

if pages = "" then
pages = 1
end if
if pages <> "" and cint(pages) < 1 then
pages = 1
end if
pagesize = 20
rs.PageSize = pagesize
rs.CacheSize = pagesize
pagecount = rs.PageCount
if cint(pages) > pagecount then
pages = pagecount
end if
rs.AbsolutePage = pages
dim i
i=(pages-1)*pagesize
while not rs.eof and i < pagesize+(pages-1)*pagesize
i=i + 1
%>
<form name="form1" method="post" action="2ssh.asp">
<tr>
<td scope="col"><div align="center">
<input name="esid" type="text" style="border:0" value="<%=rs("id")%>" size="6"

maxlength="6" readonly="true">
</div></td>
<td scope="col"><div align="center"><a href=2scarshow.asp?id=<%=rs("id")%>

target="_blank"><%=rs("t1")%></a></div></td>
<td scope="col"><div align="center"><% if rs("t3")<>"" then %><%=rs("t3")%><% else

response.write"此项未填" end if%></div></td>
<td scope="col"><div align="center"><% if rs("t7")<>"" then %><%=rs("t7")%><% else

response.write"此项未填" end if%></div></td>
<td scope="col"><div align="center"><% if rs("sj")<>"" then %><%=rs("sj")%><% else

response.write"此项未填" end if%></div></td>
<td scope="col"><div align="center"><a href=2scarshow.asp?id=<%=rs("id")%>

target="_blank">详情</a></div></td>
<td scope="col"><div align="center">
<input name="key1" type="checkbox" style="border:0" value=1<%if key1=1 then%>

checked<%end if%>>审核</div></td>
<td scope="col"><div align="center"><a href=2sdel.asp?id=<%=rs("id")%>

target="_blank">删除</a></div></td>
</tr>
<%
rs.movenext
wend
response.Write("<table><tr><td align=center>")
if (pages-1)*pagesize<>0 then
response.write "<a href=2scar.asp?pages="&pages-1&"><</a> "
end if

for iiii=1 to pagecount

response.write "<a href=2scar.asp?pages="&iiii&">"&iiii&"</a> "
next
%>
</table>
<input type="submit" name="Submit" value=" 提 交 ">
</form>

<%
if rs.RecordCount>(pages)*pagesize then
response.write " <a href=2scar.asp?pages="&pages+1&">></a>"
end if
response.Write("</td></tr></table>")
end if
%>
</table>
<%rs.close
set rs=nothing%>





2ssh.asp中的代码如下:
<%
dim cn,rs
dim ree,id
set cn = server.createobject("adodb.connection")
set rs = server.createobject("adodb.recordset")
cn.open "driver={SQL Server};server=127.0.0.1;UID=useruser1982;PWd=user19821982;Database=comcq"
ree = request.form("key1")
id = request.form("esid")
rs.Open "update escar set re=1 where re='" & ree & "'-1 and id='" & id & "'", cn
%>
...全文
177 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tikyliu 2006-04-17
  • 打赏
  • 举报
回复
rs.Open "update escar set re=1 where re='" & ree & "'-1 and id='" & id & "'", cn

error!

拜托老大,'" & ree & "'是字符串还能当数字去加减嘛?
如果字段REE为数字,ID为自动编号(数字),应该改成这样:

rs.Open "update escar set re=1 where re=" & ree & "-1 and id=" & id, cn
z5sd 2006-04-17
  • 打赏
  • 举报
回复
数据类型问题。CINT()
cchendong 2006-04-16
  • 打赏
  • 举报
回复
将”总是发送友好HTTP错误“前的复选框去掉后显示:

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: ',' 附近有语法错误。

/2ssh.asp,行 14

这是怎么回事啊?
2ssh.asp 第14行应该为
rs.Open "update escar set re=1 where re='" & ree & "'-1 and id='" & id & "'", cn
竹林听雨2005 2006-04-16
  • 打赏
  • 举报
回复
在IE的选项里,将”总是发送友好HTTP错误“前的复选框去掉,然后再运行你的网页,看错误出在哪里,再去改

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧