标题:asp问题求助
只看楼主
963852
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-10-31
 问题点数:0 回复次数:6 
asp问题求助

错误类型: Microsoft JET Database Engine (0x80040E14) Syntax error (missing operator) in query expression 'bidid in(32checked)'. /useful/now/ekui/admin_ProcessClosings.asp, 第 124 行

此段部分代码:

for i=0 to ubound(incept) conn.execute("update bids set bidstat='Y' where bidid in("&incept(i)&")") sql3="select * from bids,auctions where biditemid=auc_id and bidid ="&incept(i)&" and bidstat='Y' order by bidAmount desc" set rs3=server.createobject("adodb.recordset") rs3.Open sql3,conn,1,3 if rs3.recordcount=0 then response.write "<tr><td class=row colspan=5>没有记录</td></tr>" response.End() else

加红的是第124行,请问是什么问题?

谢谢!

搜索更多相关主题的帖子: asp 
2004-10-31 21:26
浪迹
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2004-10-31
得分:0 
sql语句出错(字段名错误,或数据类型不匹配)
2004-10-31 21:33
963852
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-10-31
得分:0 

其中 bidstat的数据类型是文本

bidid的数据类型是自动编号

应该如何改啊?

2004-10-31 21:46
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
得分:0 
bidid in(32checked) 当然出错,这个checked要去掉

天津网站建设 http://www./
2004-11-01 13:20
963852
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-10-31
得分:0 

<!--#include file="conn.asp" --> <!-- #include file="inc/info.asp" --> <!-- #include file="inc/const.asp" --> <%response.Expires=0 admheader action=rst("action") response.Write("<table width=""95%"" border=""0"" cellspacing=""1"" cellpadding=""3"" class=""tableBorder"" align=center>") response.Write("<tr><td height=""0"" width=23%\><nobr></nobr></td><td height=""0"" width=23%\><nobr></nobr></td><td height=""0"" width=23%\><nobr></nobr></td><td height=""0"" width=15%\><nobr></nobr></td><td height=""0"" width=16%\><nobr></nobr></td></tr>") response.Write("<tr><th height=""25"" colspan=5>") select case action case "refresh" str="到达底价的商品" case "showrefresh" str="成交到达底价的商品" case "dorefresh" str="成交到达底价的商品" case "refresh_no" str="没有人竞标的商品" case "dorefresh_no" str="结束没有人竞标的商品" case "refresh_nogetdi" str="未到达底价的商品" case "showrefresh_nogetdi" str="结束未到达底价的商品" case "dorefresh_nogetdi" str="结束未到达底价的商品" case "delauc" str="删除错误的商品" case "dodelauc" str="删除错误的商品" case else err_msg="错误" call aspease_err end select response.write str response.write "</th></tr>" select case action case "refresh" call refresh case "showrefresh" call showrefresh case "dorefresh" call dorefresh case "refresh_no" call refresh_no case "dorefresh_no" call dorefresh_no case "refresh_nogetdi" call refresh_nogetdi case "showrefresh_nogetdi" call showrefresh_nogetdi case "dorefresh_nogetdi" call dorefresh_nogetdi case "delauc" call delauc case "dodelauc" call dodelauc case else err_msg="错误" call aspease_err end select admfooter response.write "</table></body></html>" '#########有人竞标达到低价,可以成交结束的商品 sub refresh sql = "select * from auctions where auc_CurrentBid>auc_ReservePrice and auc_ended ='N' and datediff('s',now(),auc_CloseDate)<=0 order by auc_CloseDate desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write " <tr><td class=row colspan=5>现在没有结束的商品</td></tr>" else response.write "<tr><td class=row colspan=5>现在已经有" & rs.recordcount & " 个结束的商品,请点击商品连接进行交易</td></tr>" response.write "<tr><td class=row colspan=3>商品名称</td><td class=row colspan=2>查看详细</td></tr>" do while not rs.eof response.write "<tr><td class=row colspan=3><a href=?action=showrefresh&aucid="&fval(rs("auc_id"))&">"&rs("auc_itemtitle")&"</a>&nbsp;</td><td colspan=2 class=row><a href=?action=showrefresh&aucid="&fval(rs("auc_id"))&">查看详细</a></td></tr>" rs.movenext loop end if end sub sub showrefresh aucid=fval(rst("aucid")) sql = "select * from bids,auctions where auc_id =biditemid and biditemid="&sqlval(aucid)&" and auc_ended='N' order by bidAmount desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 response.Write("<tr><td class=row colspan=5>直接点击“成交”即可完成交易</td></tr>") response.Write(" <tr>") response.Write(" <th height=""25"">商品名称</th>") response.Write(" <th height=""25"">所出价格</th>") response.Write(" <th height=""25"">买家</th>") response.Write(" <th height=""25"">卖家</th>") response.Write(" <th height=""25"">执行操作</th>") response.Write(" </tr>") response.Write("<form action=""?action=dorefresh"" name=""form"" method=post>") response.Write("<input type=hidden name=h1 value=" & aucid & ">") response.Write("<input type=hidden name=owner value=" & fval(rs("auc_ItemOwner")) & ">") i=0 while not rs.eof response.Write("<tr><td><a href=""viewitem.asp?aucid=" & aucid & """ target=_blank>" & rs("auc_itemtitle") & "</a></td>") response.Write("<td>" & rs("bidAmount") & "</td>") response.Write("<td><a href=contact.asp?userid=" & fval(rs("bidBidderID")) & " target=_blank>" & aspeaseusername(sqlval(rs("bidBidderID"))) & "</a></td>") response.Write("<td><a href=contact.asp?userid=" & fval(rs("auc_ItemOwner")) & " target=_blank>" & aspeaseusername(sqlval(rs("auc_ItemOwner"))) & "</a></td>") response.Write("<td>" & rs("bidID") & "<input type=checkbox name=""c1"" value=" & fval(rs("bidID"))) if i < fval(rs("auc_Numleft")) then response.write("checked") else response.write("disabled") end if response.Write("></td></tr>") rs.movenext i=i+1 wend response.Write("<tr><td colspan=5><input type=submit name=submit value=""成交""></td></tr></form>") end sub sub dorefresh dim biditemid bidid=rst("c1") bidid=replace(bidid,"'","") bidid=replace(bidid,";","") bidid=replace(bidid,"--","") bidid=replace(bidid,")","") biditemid=rst("h1") incept=split(bidid,",") for i=0 to ubound(incept) conn.execute("update bids set bidstat='Y' where bidid in ("&incept(i)&")") sql3="select * from bids,auctions where biditemid=auc_id and bidid ="&incept(i)&" and bidstat='Y' order by bidAmount desc" set rs3=server.createobject("adodb.recordset") rs3.Open sql3,conn,1,3 if rs3.recordcount=0 then response.write "<tr><td class=row colspan=5>没有记录</td></tr>" response.End() else rs3.movefirst do while not rs3.eof conn.execute "insert into gets(get_itemid,get_date,get_buyerid,get_num,get_amount,get_bidid,get_sellerid,get_type) values("&sqlval(rs3("biditemid"))&",'"&sqldate(now())&"',"&sqlval(rs3("bidBidderID"))&","&sqlval(rs3("bidnum"))&","&sqlval(rs3("bidAmount"))&","&sqlval(rs3("bidid"))&","&sqlval(rs3("auc_ItemOwner"))&",0)" rs3.movenext loop conn.execute("update auctions set auc_ended='Y',auc_numleft=auc_numleft-"&rs3.recordcount&" where auc_id ="&sqlval(biditemid)) end if next response.Write("<tr><td class=row colspan=5>交易成功 ,请返回</td></tr>") end sub '#################无人竞标的商品已经到期############## sub refresh_no sql = "select * from auctions where auc_ended='N' and auc_Bidtimes=0 and datediff('s',now(),auc_CloseDate)<=0 order by auc_CloseDate desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof then response.write "<tr><td class=row colspan=5>现在没有结束的商品</td></tr>" response.end end if response.Write(" <tr> ") response.Write(" <th width=""23%"" height=""25"">商品名称</th>") response.Write(" <th width=""23%"" height=""25"">开始时间</th>") response.Write(" <th width=""23%"" height=""25"">结束时间</th>") response.Write(" <th width=""15%"" height=""25"">卖家</th>") response.Write(" <th width=""16%"" height=""25"">执行操作</th>") response.Write(" </tr> ") response.Write(" <form action=""?action=dorefresh_no"" name=""form"" method=post>") i=1 while not rs.eof response.Write(" <tr> ") response.Write(" <td width=""23%"">&nbsp;<a href=""viewitem.asp?aucid=") response.Write(fval(rs("auc_id"))) response.Write(""" target=""_blank"">") response.Write(rs("auc_itemtitle")) response.Write("</a></td>") response.Write(" <td width=""23%"">&nbsp;") response.Write(sqldate(rs("auc_AvailDate"))) response.Write("</td>") response.Write(" <td width=""23%"">&nbsp;") response.Write(sqldate(rs("auc_CloseDate"))) response.Write("</td>") response.Write(" <td width=""15%"">&nbsp;") response.Write(aspeaseusername(sqlval(rs("auc_ItemOwner")))) response.Write("</td>") response.Write(" <td width=""16%""><input type=""checkbox"" name=""c1"" value=""") response.Write(fval(rs("auc_id"))) response.Write(""" checked></td>") response.Write(" </tr>") rs.movenext i=i+1 wend response.Write(" <tr>") response.Write(" <td colspan=""5""><input type=submit name=submit value=""结束""></td>") response.Write(" </tr>") response.Write(" </form>") end sub

sub dorefresh_no aucid=request("c1") conn.execute("update auctions set auc_ended='Y' where auc_id in ("&aucid&")") response.Write("<script language=javascript>{alert( '商品结束操作成功');location.href='admin_ProcessClosings.asp?action=refresh_no';}</script>") end sub

'##########################有人竞标,但是没有达到底价, '这时都不成交,使商品结束,卖家可以重新挂出再卖 sub refresh_nogetdi sql = "select * from auctions where auc_currentbid>auc_StartingBid and auc_CurrentBid<auc_ReservePrice and auc_ended ='N'and datediff('s',now(),auc_CloseDate)<=0 order by auc_CloseDate desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "<tr><td class=row colspan=5>现在没有未达到底价结束的商品</td></tr>" else response.write "<tr><td class=row colspan=5>现在已经有"&rs.recordcount&"个结束的商品,请点击商品连接进行结束吧</td></tr>" do while not rs.eof response.write "<tr><td class=row colspan=5><a href=?action=showrefresh_nogetdi&aucid="&fval(rs("auc_id"))&">"&rs("auc_itemtitle")&"</a>&nbsp;</td></tr>" rs.movenext loop end if end sub

sub showrefresh_nogetdi aucid=fval(rst("aucid")) sql = "select * from bids,auctions where auc_id =biditemid and biditemid="&sqlval(aucid)&" and auc_ended='N' order by bidAmount desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 response.Write("<tr>") response.Write(" <td class=row colspan=5>直接点击“结束”即可完成商品结束</td>") response.Write(" </tr>") response.Write("<tr> ") response.Write(" <th height=""25"">商品名称</th>") response.Write(" <th height=""25"">所出价格</th>") response.Write(" <th height=""25"">买家</th>") response.Write(" <th height=""25"">卖家</th>") response.Write(" <th height=""25"">执行操作</th>") response.Write(" </tr>") response.Write(" <form action=""?action=dorefresh_nogetdi"" name=""form"" method=post>") response.Write(" <input type=hidden name=""h1"" value=""") response.Write(aucid) response.Write(""">") response.Write(" <input type=hidden name=""owner"" value=""") response.Write(fval(rs("auc_ItemOwner"))) response.Write(""">") i=0 while not rs.eof response.Write(" <tr>") response.Write(" <td><a href=""viewitem.asp?aucid=" & aucid & """ target=_blank>" & rs("auc_itemtitle") & "</a></td>") response.Write(" <td>" & rs("bidAmount") & "</td>") response.Write(" <td>") response.Write(" <a href=contact.asp?userid=" & fval(rs("bidBidderID")) & " target=_blank>") response.Write(aspeaseusername(sqlval(rs("bidBidderID"))) & "</a></td> ") response.Write(" <td><a href=contact.asp?userid=" & fval(rs("auc_ItemOwner")) & " target=_blank>") response.Write(aspeaseusername(sqlval(rs("auc_ItemOwner"))) & "</a></td>") response.Write(" <td>" & rs("bidID") & "<input type=checkbox name=""c1"" value=" & fval(rs("bidID"))) if i < fval(rs("auc_Numleft")) then response.write("checked") else response.write("disabled") end if response.Write("></td></tr>") rs.movenext i=i+1 wend response.Write(" <tr>") response.Write(" <td colspan=6>") response.Write(" <input type=submit name=submit value=""结束"">") response.Write(" </td>") response.Write(" </tr>") response.Write(" </form>") end sub sub dorefresh_nogetdi bidid=rst("c1") bidid=replace(bidid,"'","") bidid=replace(bidid,";","") bidid=replace(bidid,"--","") bidid=replace(bidid,")","") biditemid=fval(rst("h1")) incept=split(bidid,",") for i=0 to ubound(incept) conn.execute("delete from bids where bidid in("&incept(i)&")") next conn.execute("delete from msg where msg_aucid ="&rst("h1")&"") conn.execute("update auctions set auc_ended='Y' where auc_id ="&sqlval(biditemid)) response.Write("<script language=javascript>") response.Write(chr(10)) response.Write("{alert( '该商品已经结束成功');") response.Write(chr(10)) response.Write("location.href='admin_ProcessClosings.asp?action=refresh_nogetdi';}") response.Write(chr(10)) response.Write("</script>") end sub

'#############################删除错误的商品################ sub delauc response.Write("<form name=""form1"" method=""post"" action=""?action=dodelauc"">") response.Write(" <tr>") response.Write(" <td class=row> 请输入要删除的商品编号 </td>") response.Write(" <td class=row colspan=4> <input type=""text"" name=""auc_id""> <input type=""submit"" name=""Submit"" value=""删除""></td> ") response.Write("</tr>") response.Write("</form>") end sub sub dodelauc auc_id=rst("auc_id") if auc_id="" or isnumeric(auc_id)=false then response.write "<tr><td class=row>请输入正确的编号</td></tr>" response.end else conn.execute("delete from auctions where auc_id="&sqlval(auc_id)) conn.execute("delete from bids where bidItemID="&sqlval(auc_id)) conn.execute("delete from careauc where careItemID="&sqlval(auc_id)) conn.execute("delete from pingjia where pj_aucid="&sqlval(auc_id)) conn.execute("delete from msg where msg_aucid="&sqlval(auc_id)) conn.execute("delete from tuijian where tj_aucid="&sqlval(auc_id)) conn.execute("delete from upshelf where up_aucid="&sqlval(auc_id)) response.write "<tr><td class=row colspan=5>数据删除成功!!</td></tr>" response.end end if end sub %>

[此贴子已经被作者于2004-11-01 22:18:06编辑过]

2004-11-01 22:16
963852
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-10-31
得分:0 

红色的是出错行

应该如何修改啊

哪位高手知道?

2004-11-01 22:19
haifeng
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2004-11-4
得分:0 
我是菜鸟级别,请高手们帮他解决此问题吧!

2004-11-04 22:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-6840-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.761711 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved