home
DTS Activex executing stored procedures
Author Nigel Rivett
dim objCN
dim objCMD
dim objRS
strConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;"
strConnectionString = strConnectionString & "Initial Catalog=" & DTSGlobalVariables("DatabaseName").Value
strConnectionString = strConnectionString & ";Packet Size=4096;
strConnectionString = strConnectionString & "DataSource=" & DTSGlobalVariables("ServerName").Value
set objCN = CreateObject("ADODB.Connection")
set objCMD = CreateObject("ADODB.Command")
objCN.open strConnectionString
objCMD.ActiveConnection = objCN
objCMD.CommandText = "spMySp"
objCMD.CommandType = 4 'adCmdStoredProc
objCMD.Parameters.Append objCMD.CreateParameter("OutParmInt",3,2)
objCMD.Parameters.Append objCMD.CreateParameter("InParmStr1",200,1,10,DTSGlobalVariables("StrData1"))
objCMD.Parameters.Append objCMD.CreateParameter("InParmStr2",200,1,255,DTSGlobalVariables("StrData2"))
Set objRS = objCMD.Execute
set objRS = nothing
DTSGlobalVariables("SPOutParm").Value = objCMD.Parameters("OutParmInt")
set objCMD = nothing
set objCN = nothing
home