asp输出 请问这样写有错吗。 输出是空, 正确应该是1 才对,求教

代码之城 2017-12-15 10:40:46

order_sum_sql=conn.execute("SELECT COUNT(DISTINCT pro_id) FROM taborder_product WHERE pro_id IN (SELECT id FROM tabproduct WHERE ManageName_id =" & Session("ManageName_id") & "")

response.Write order_sum_sql(0)


请问这样写有错吗。 输出是空, 正确应该是1 才对,求教
...全文
1065 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dogfish 2018-03-02
  • 打赏
  • 举报
回复
另外,可以输出语句,然后运行一下是否正确。
Dogfish 2018-03-02
  • 打赏
  • 举报
回复
好像语句有出错的。少了一个闭括号。
wcwtitxu 2018-01-31
  • 打赏
  • 举报
回复
SET order_sum_sql = conn.execute( .... ) SET 少了
文盲老顾 2018-01-17
  • 打赏
  • 举报
回复
response.Write "<<<" & rs_update.Fields(0).Value & ">>>" 这样试试
  • 打赏
  • 举报
回复
改用左联接写法试试
代码之城 2017-12-16
  • 打赏
  • 举报
回复
order_sum_sql="select count(pro_id) from taborder_product where pro_id in (select id from tabproduct where ManageName_id= " & Session("ManageName_id")
  set rs_update=CreateObject("adodb.Recordset")
	rs_update.open order_sum_sql,conn,1,3
	
	        if not rs_update.eof then
				response.Write "<<<>>><br>"
				response.Write "<<<" & rs_update(0) & ">>>"
				response.Write "<br>" & order_sum_sql
				
			else
			response.Write order_sum_sql
			
			END IF
这样输出的是 , 第二行还是空,到底是怎么回事啊 <<<>>> select count(pro_id) from taborder_product where pro_id in (select id from tabproduct where ManageName_id= 5
hookee 2017-12-16
  • 打赏
  • 举报
回复
SET order_sum_sql= .... order_sum_sql 是记录集RecodSet对象
php_wsd 2017-12-15
  • 打赏
  • 举报
回复
试试我改过的这个语句
php_wsd 2017-12-15
  • 打赏
  • 举报
回复
order_sum_sql=conn.execute("select count(*) from (SELECT DISTINCT pro_id FROM taborder_product WHERE pro_id IN (SELECT id FROM tabproduct WHERE ManageName_id =" & Session("ManageName_id") & ")")
代码之城 2017-12-15
  • 打赏
  • 举报
回复
在数据库中 运行是1, 但是放asp里 是空
php_wsd 2017-12-15
  • 打赏
  • 举报
回复
你先拿这个sql到数据库中运行一下看看是否正常
php_wsd 2017-12-15
  • 打赏
  • 举报
回复
set order_sum_sql=…… response.Write order_sum_sql(0) 这样试试
代码之城 2017-12-15
  • 打赏
  • 举报
回复
楼上不对啊, 还是空啊

28,390

社区成员

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

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