' set the connection string ' set parameters for stored procedure (i.e. two parameters here) ' destroy the object
' set the parameters of your database here
strDatabaseName = ""
strUser = ""
strPassword = ""
strStoredProcedureName = ""
' create the database object
Set objDB = CreateObject("ADODB.Command")
objDB.ActiveConnection = "DRIVER={Microsoft ODBC for Oracle}; " & _
"SERVER=" & strDatabaseName & _
";User ID=" & strUser & ";Password=" & strPassword & " ;"
' set the command type to Stored Procedures
objDB.CommandType = 4
objDB.CommandText = strStoredProcedureName
' define Parameters for the stored procedure
objDB.Parameters.Refresh
objDB.Parameters(0).Value = "Param1"
objDB.Parameters(1).Value = "Param2"
' execute the stored procedure
objDB.Execute()
Set objDB = Nothing
Wednesday, 19 October 2011
QTP Script: Some code that should help you execute a stored procedure.
07:16
No comments
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment