Hi Helen
Thanks for that. That extension is pretty much what I was suggesting I would write. So saved me the trouble. :)
However, I had all sorts of problems getting an array into it (which contains the parameters) from C# Script. To get it in the right format (as far as I can tell) I would have had to use a scripting object to generate a safe array/list, then convert that to a VBArray.
Which seemed like a lot of extra hassle.
So I modified the extension script so that it took in a delimited string (using "|" as the separator as this is seldom used in SQL). Then simply used a "Split" inside the script extension to create the VB type array within the extension, rather than having to pass it in. Much easier to create a delimited string in C# Script (and thus Jscript) than a VB type array!
Works great now. Thanks.
Here is the modified extension script code:
Function CallObjectMethod(obj, method, paramIN)
Dim params, paramStr, i, result
params = Split(paramIN, "|")
paramStr = ""
For i = 0 To UBound(params)
paramStr = paramStr & "params(" & i & ")"
If i < UBound(params) Then paramStr = paramStr & ", "
Next
Execute("Call obj." & method & "(" & paramStr & ")")
CallObjectMethod = params
End Function