|
,终于研究出来了,给大家看看
Set objCn = CreateObject("ADODB.Connection")
str = "provide=MSDAORA.1;userid=system;password=####;data source=###"
objCn.ConnectionString = str
objCn.CursorLocation = 3 '参数都不能写成常量的形势,必须要写成整型
objCn.Open
Set adoComm = CreateObject("ADODB.Command")
With adoComm
.ActiveConnection = objCn
.CommandType = 4
.CommandText = "temp.temp"
Set para_trade = CreateObject("ADODB.Parameter")
para_trade.Name = "startdate"
para_trade.Type = 200'这个参数是用于varchar2入参
para_trade.Size = 1000
para_trade.Direction = 1
para_trade.Value = "20080516"
.Parameters.Append para_trade
Set para_trade1 = CreateObject("ADODB.Parameter")
para_trade1.Name = "enddate"
para_trade1.Type = 200
para_trade1.Size = 1000
para_trade1.Direction = 1
para_trade1.Value = "20080516"
.Parameters.Append para_trade1
rs=CreateObject("ADODB.Recordset")'存储过程返回的游标
Set rs = .Execute()
End With
If Not rs.EOF Then
Call msgbox (rs.RecordCount)
Call msgbox ("test!!!!!!!!!!!!" & rs(3))
rs.Close
End If
objCn.Close
Set rs = Nothing
Set adoComm = Nothing |
|