下面是存储过程
CREATE PROCEDURE ctemp(@constructnumeric int )
asbegin tran SELECT SUM(CONVERT(decimal(9, 3), a.totalrate)) * CONVERT(decimal(9, 3), b.unitprice)
AS 总价 into #T1
FROM dbo.productmateria a LEFT OUTER JOIN
dbo.materiabase b ON a.materialcode = b.materialcode
WHERE a.constractnumeric = @constructnumeric
GROUP BY a.materialcode, a.totalrate, b.unitprice
set nocount on
select sum(总价) as 总额 from #T1经SQL查询分析器调试结果为:936033.777300下面是在VB前台调用该过程,却不知如何取得调试结果?
With cmd1
.ActiveConnection = MYCNN
.CommandType = adCmdStoredProc
.CommandText = "ctemp"
.Parameters(1) = CLng(Text1.Text)
.execute
end with
谢谢
CREATE PROCEDURE ctemp(@constructnumeric int )
asbegin tran SELECT SUM(CONVERT(decimal(9, 3), a.totalrate)) * CONVERT(decimal(9, 3), b.unitprice)
AS 总价 into #T1
FROM dbo.productmateria a LEFT OUTER JOIN
dbo.materiabase b ON a.materialcode = b.materialcode
WHERE a.constractnumeric = @constructnumeric
GROUP BY a.materialcode, a.totalrate, b.unitprice
set nocount on
select sum(总价) as 总额 from #T1经SQL查询分析器调试结果为:936033.777300下面是在VB前台调用该过程,却不知如何取得调试结果?
With cmd1
.ActiveConnection = MYCNN
.CommandType = adCmdStoredProc
.CommandText = "ctemp"
.Parameters(1) = CLng(Text1.Text)
.execute
end with
谢谢
解决方案 »
- 考试题 求大侠帮忙
- 请教高手insert问题
- 关于S_Grid_2控件使用
- 关于win98和win2000的保密性问题,高手请进~~~~~~~~~~~
- 文件问题
- 怎樣用VB實現在FTP上生成目錄及把此FTP上的一些文件復制到此目錄下
- 行 17: 控件 ProgressBar1 的类 MSComctlLib.ProgressBar 不是一个已加载的控件类。
- 如何把某一具体日期转换成农历!不要用其它控件呀!
- 哪儿可下载最新的microsoft multimedia control 控件?
- 请问,於AddIn中,如何共用CommandBarEvents?
- 有谁提供一下用VB写ASP组件方面的资料
- 很菜的问题
Dim rs As ADODB.Recordset
Dim com1 As ADODB.Command
Dim par1 As ADODB.Parameter
Private Sub Command1_Click()
Set com1 = New ADODB.Command
Set com1.ActiveConnection = con
com1.CommandText = "proc_demo"
com1.CommandType = adCmdStoredProc
com1.Parameters.Refresh
com1.Parameters(0).Value = "DH010001,DH010003"
Set rs = com1.Execute()
MsgBox "ok"
End Sub
rs.open "exec ctemp 123 ",cn,1,3
if not rs.eof then msgbox rs.fields(0)
.ActiveConnection = MYCNN
.CommandType = adCmdStoredProc
.CommandText = "ctemp"
.Parameters(1) = CLng(Text1.Text)
dim Rs as recordset
set rs=new recordset
set rs=.execute
msgbox "总额为:" & rs.fields("总额")
end with