请教数据库

leeloo 2003-09-22 04:02:35
<%
cus_id = Request.Cookies("cus_id")
if cus_id = "" then
Response.Redirect("../index.htm")
End If

selectitem = request("selcet")

set conTemp=Server.CreateObject("ADODB.Connection")
dbpath = Server.MapPath("../sra.mdb")
conTemp.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath

rderallSQL="SELECT * FROM status_check WHERE order_no in ("& selectitem &") ORDER BY proforma DESC"
set rsorderall=conTemp.execute(orderallSQL)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
Response.Write "<br>您一共选择了"&request("selcet").count&"项,"
Response.Write "<br>您选择的项目有:" & selectitem
%>

</body>
</html>

-------------------------------------
把第13、14行
rderallSQL="SELECT * FROM status_check WHERE order_no in ("& selectitem &") ORDER BY proforma DESC"
set rsorderall=conTemp.execute(orderallSQL)
删除掉就好了
可是那我怎么进行筛选啊
so
请教诸位
...全文
71 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
leeloo 2003-09-24
  • 打赏
  • 举报
回复
TO hooyke(红旗下的蛋)
哪个o是我编辑贴子的时候不小心删掉的
在源代码中没有这个错误

TO dicklee1214(令狐冲) & BingGroup()
下面的语句中有打印selectitem
而其打印的结果是1,2,3的
查阅SQL的书,应当为
select id,name from table
where id in ( 1,2,3,4)
BingGroup 2003-09-23
  • 打赏
  • 举报
回复
in 子句有问题

select id,name from table
where id in ( '1','2','3','4')
dicklee1214 2003-09-23
  • 打赏
  • 举报
回复
in ("& selectitem &")有问题 ;selectitem 不是集合
  • 打赏
  • 举报
回复
呵呵,

A。 rderallSQL="SELECT * FROM status_check WHERE order_no in ("& selectitem &") ORDER BY proforma DESC"

B. set rsorderall=conTemp.execute(orderallSQL)

B句执行的不是A句的SQL命令啊! 是 orderallSQL 不是 rderallSQL 当然出错了!!!
少了O

  • 打赏
  • 举报
回复
rderallSQL="SELECT * FROM status_check WHERE order_no in ("& selectitem &") ORDER BY proforma DESC"


是这句的问题,所以执行时侯会提示 set rsorderall=conTemp.execute(orderallSQL)
错误!

leeloo 2003-09-23
  • 打赏
  • 举报
回复
如果没有传输select的话
这句话是没有问题的

在别的页面里我一直用这句话
没有问题的
stwfa 2003-09-22
  • 打赏
  • 举报
回复
set rsorderall=conTemp.execute(orderallSQL)
可能是这句话有问题。
不老书生 2003-09-22
  • 打赏
  • 举报
回复
把第13、14行
rderallSQL="SELECT * FROM status_check WHERE order_no in ("& selectitem &") ORDER BY proforma DESC"
set rsorderall=conTemp.execute(orderallSQL)
删除掉就好了

“就好了”是什么意思?就能执行了?
leeloo 2003-09-22
  • 打赏
  • 举报
回复
请诸位解释的详细一点
谢谢

出错信息
---------------------------
技术信息(适用于支持人员)

错误类型:
Microsoft JET Database Engine (0x80040E10)
/cus/printorder.asp, 第 14 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.1.4322)

页:
POST 50 bytes to /cus/printorder.asp

POST 数据:
Submit=PrintingPreview&selcet=PR5606&selcet=PR5607

时间:
2003年9月22日, 16:05:16


详细信息:
Microsoft 支持
不老书生 2003-09-22
  • 打赏
  • 举报
回复
实际上我没看明白
pp4u 2003-09-22
  • 打赏
  • 举报
回复
用rs.find

28,406

社区成员

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

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