Hi All,
I have tried to execute a stored procedure from QTP. Please find below
the script that I have used. I am not sure whether this is correct or
now. I have referred so many sites and worked on this. The below
script was executed without any error. Anybody please tell me how to
output the results after executing the stored procedure.

Function RunStoredProcedure(StoredProcedureName)
''Create the database object
Set cm = CreateObject("ADODB.Command")
' Activate the connection.
Set rs=createobject("adodb.recordset")
cm.open"provider=sqloledb.
1;server=servername;uid=username;pwd=passowrd;database=databasename"
' Set the command type to Stored Procedures
cm.CommandType = 4
' Stored Procedures
cm.CommandText = StoredProcedureName
' Define Parameters for the stored procedure
cm.Parameters.Refresh

' Execute the stored procedure
cm.Execute()

Set cm = Nothing
End Function



Thanks and Regards,
Dhanya













--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to