Forum Discussion
HKosova
11 years agoSmartBear Alumni (Retired)
Hi Sean,
ADOCommand.Execute returns the number of affected records through the RecordsAffected parameter, not through the return value. Here's a quote from the documentation:
Set recordset = command.Execute(RecordsAffected, Parameters, Options)
RecordsAffected
Optional. A Long variable to which the provider returns the number of records that the operation affected. The RecordsAffected parameter applies only for action queries or store procedures.
The only thing is, RecordsAffected is an out parameter and C#Script doesn't support out parameters natively. You can try the OutParameterWrapper extension as a workaround. Something along the lines of (I didn't test this though):
var params = ConvertJScriptArray([0]);
var result = OutParameterWrapper.CallObjectMethod(Cmd, "Execute", params).toArray();
Log.Message(result[0]);
Hope this helps!
Related Content
- 2 years ago
- 5 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago