dreamweaver中查询出来的某字段的数据进行计算统计
<%Dimrs1Dimrs1_cmdDimrs1_numRowsSetrs1_cmd=Server.CreateObject("ADODB.Command")rs1_cm...
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_conm_STRING
rs1_cmd.CommandText = "SELECT * FROM ruku"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
set rs1=server.CreateObject("adodb.recordset")
rs1_sql= "SELECT SUM(jine) from ruku where id=jine"
rs1.open sql,conm,1,1
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
这段代码错在哪,body中有重复区域 展开
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_conm_STRING
rs1_cmd.CommandText = "SELECT * FROM ruku"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
set rs1=server.CreateObject("adodb.recordset")
rs1_sql= "SELECT SUM(jine) from ruku where id=jine"
rs1.open sql,conm,1,1
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
这段代码错在哪,body中有重复区域 展开
展开全部
set rs1=server.CreateObject("adodb.recordset")
rs1_sql= "SELECT SUM(jine) from ruku where id=jine"
rs1.open sql,conm,1,1 这是你自己加的 不要xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
改在rs1_cmd.CommandText = "SELECT SUM(jine) as bbbb FROM ruku"
在右边应用程序记录集就能看到,拖出显示就可以了。
金额= rs1("bbbb")
rs1_sql= "SELECT SUM(jine) from ruku where id=jine"
rs1.open sql,conm,1,1 这是你自己加的 不要xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
改在rs1_cmd.CommandText = "SELECT SUM(jine) as bbbb FROM ruku"
在右边应用程序记录集就能看到,拖出显示就可以了。
金额= rs1("bbbb")
更多追问追答
追问
你很厉害啊,一下就看出我的那些是自己加的,确实是我乱加的,不过你改的有一个问题,你改的是记录集rs1只选择表中的jine总数作为输出了,我其他的字段都没有匹配了。所以出现了Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。
/web1/fahuolist.asp, 第 13 行
这个错误
追答
加上呀
SELECT SUM(jine) as bbbb , 价格,名称 FROM ruku"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |