call to COM object returns empty variant array??? 
Author Message
 call to COM object returns empty variant array???

What is wrong with this???

Com object.method definition...

Public Sub foo(ByRef vArray As Variant)
...some code
    vArray.ReDim (x,y)
....code to open ADO recordset
....code to populate vArray...
End Sub

in VBScript...
.
Dim vArrayInput

' RDS is already created as a Remote Data Services Dataspace object

Set MyObject = RDS.CreateObject("Object.class", "<%=server%>")

Call MyObject.foo(vArrayInput)

'the object is properly created, and the call to the method is successful
'however the input parameter array variable (vArrayInput) is
'properly dimensioned in the MyObject.foo method, but the array
'elements are all empty except for element (0,0) which is now set to 0.
'The call to MyObject.foo works perfectly using the same syntax on
'server side (ASP), and also from a call in a Visual Basic App.
'Any help or ideas is most appreciated!



Sun, 15 Sep 2002 03:00:00 GMT  
 call to COM object returns empty variant array???
Sounds like the problem is in

....code to populate vArray...

--
Michael Harris
MVP Scripting

What is wrong with this???

Com object.method definition...

Public Sub foo(ByRef vArray As Variant)
...some code
    vArray.ReDim (x,y)
....code to open ADO recordset
....code to populate vArray...
End Sub

in vbScript...
.
Dim vArrayInput

' RDS is already created as a Remote Data Services Dataspace object

Set MyObject = RDS.CreateObject("Object.class", "<%=server%>")

Call MyObject.foo(vArrayInput)

'the object is properly created, and the call to the method is successful
'however the input parameter array variable (vArrayInput) is
'properly dimensioned in the MyObject.foo method, but the array
'elements are all empty except for element (0,0) which is now set to 0.
'The call to MyObject.foo works perfectly using the same syntax on
'server side (ASP), and also from a call in a Visual Basic App.
'Any help or ideas is most appreciated!



Sun, 15 Sep 2002 03:00:00 GMT  
 call to COM object returns empty variant array???
The call works fine when I call it from ASP (server side), or when called
from a VB application.  It returns everything as expected.  It is only
failing when being called from vbScript (client side).  It is being
instantiated through an RDS dataspace.  Is there some problem with passing
variant arrays ByRef from vbScript and having them populated in the COM
object?  We are passing other variants ByRef from vbScript to the COM object
and they are returning proper values, however one is an Integer, the other
is a String.  The only problem seems to be with the Variant Array.  Thanks
for the response, and help is desperately needed! :)


Quote:
> Sounds like the problem is in

> ....code to populate vArray...

> --
> Michael Harris
> MVP Scripting




Quote:
> What is wrong with this???

> Com object.method definition...

> Public Sub foo(ByRef vArray As Variant)
> ...some code
>     vArray.ReDim (x,y)
> ....code to open ADO recordset
> ....code to populate vArray...
> End Sub

> in vbScript...
> .
> Dim vArrayInput

> ' RDS is already created as a Remote Data Services Dataspace object

> Set MyObject = RDS.CreateObject("Object.class", "<%=server%>")

> Call MyObject.foo(vArrayInput)

> 'the object is properly created, and the call to the method is successful
> 'however the input parameter array variable (vArrayInput) is
> 'properly dimensioned in the MyObject.foo method, but the array
> 'elements are all empty except for element (0,0) which is now set to 0.
> 'The call to MyObject.foo works perfectly using the same syntax on
> 'server side (ASP), and also from a call in a Visual Basic App.
> 'Any help or ideas is most appreciated!



Mon, 16 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. returning empty variant array from COM object?

2. JavaScript access variant array returned by COM object?

3. Type Mismatch returning variant array from COM object

4. Com+ returns variant array, but

5. Com+ returns variant array, but

6. JScript call COM object with VARIANT variable reference

7. Empty Arrary when VBScript calls VB COM object.

8. Pass Variant Array to a COM Object

9. Calling COM obj returning array question

10. CDec returns empty variant

11. Empty Variant Returned from VB DLL

12. Returning array from COM object

 

 
Powered by phpBB® Forum Software