Problem passing a variant array out of VBasic object to ASP 
Author Message
 Problem passing a variant array out of VBasic object to ASP

This may sound odd, particularly as you have declared the vaiables as
Variants in the object, but try declaring them as they really are in the
object (i.e. string, integer, etc) and casting them as such when you call
the object from the ASP. i.e

 iIncompleteOrders = objBilling.RetrieveIncompleteOrders( CStr(aryLogin),
CStr(aryIncompleteOrders) )

I read this as a solution to the very same problem in another NG, hope it
helps.

Regards,
Andrew

Quote:

>I've done something silly here but can't quite figure it out. I sure would
>appreciate it if someone would be good enough to point out the error.

>In an ASP file, I have an empty array. This empty array is passed to a
>VBasic created COM object that fills the array and then that object returns
>the number of rows it put into the array. That's the theory, anyway. The
>reality is

>    Microsoft VBScript runtime error '800a000d'
>    Type mismatch: 'objBilling.RetrieveIncompleteOrders'

>Here's the code in the calling ASP file (bits have been snipped for
>brevity):

> Dim aryLogin : aryLogin = Session("s_aryLogin")
> dim aryIncompleteOrders()
> dim iIncompleteOrders
> .
> .
>  Set objBilling = Server.CreateObject("Checkerboard.CBilling")
>  iIncompleteOrders = objBilling.RetrieveIncompleteOrders( aryLogin,
>aryIncompleteOrders )
> .
> .

>Here's the code in the called VBasic CLS file:

>Public Function RetrieveIncompleteOrders(ByVal aryCust As Variant, ByRef
>aryIncompleteOrders() As Variant) As Variant

>ReDim aryIncompleteOrders(0 To 3, 0 To 2)

>aryIncompleteOrders(0, 0) = "CELL_0_0"
>aryIncompleteOrders(0, 1) = "CELL_0_1"
>aryIncompleteOrders(0, 2) = "CELL_0_2"

>aryIncompleteOrders(1, 0) = "CELL_1_0"
>aryIncompleteOrders(1, 1) = "CELL_1_1"
>aryIncompleteOrders(1, 2) = "CELL_1_2"

>aryIncompleteOrders(2, 0) = "CELL_2_0"
>aryIncompleteOrders(2, 1) = "CELL_2_1"
>aryIncompleteOrders(2, 2) = "CELL_2_2"

>aryIncompleteOrders(3, 0) = "CELL_3_0"
>aryIncompleteOrders(3, 1) = "CELL_3_1"
>aryIncompleteOrders(3, 2) = "CELL_3_2"

>RetrieveIncompleteOrders = UBound(aryIncompleteOrders, 1) + 1
>End Function

>=================================================
>1 + 1 = 3 for sufficiently large values of 1.

>Richard Lewis Haggard



Sun, 07 Apr 2002 03:00:00 GMT  
 Problem passing a variant array out of VBasic object to ASP
I've done something silly here but can't quite figure it out. I sure would
appreciate it if someone would be good enough to point out the error.

In an ASP file, I have an empty array. This empty array is passed to a
VBasic created COM object that fills the array and then that object returns
the number of rows it put into the array. That's the theory, anyway. The
reality is

    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'objBilling.RetrieveIncompleteOrders'

Here's the code in the calling ASP file (bits have been snipped for
brevity):

 Dim aryLogin : aryLogin = Session("s_aryLogin")
 dim aryIncompleteOrders()
 dim iIncompleteOrders
 .
 .
  Set objBilling = Server.CreateObject("Checkerboard.CBilling")
  iIncompleteOrders = objBilling.RetrieveIncompleteOrders( aryLogin,
aryIncompleteOrders )
 .
 .

Here's the code in the called VBasic CLS file:

Public Function RetrieveIncompleteOrders(ByVal aryCust As Variant, ByRef
aryIncompleteOrders() As Variant) As Variant

ReDim aryIncompleteOrders(0 To 3, 0 To 2)

aryIncompleteOrders(0, 0) = "CELL_0_0"
aryIncompleteOrders(0, 1) = "CELL_0_1"
aryIncompleteOrders(0, 2) = "CELL_0_2"

aryIncompleteOrders(1, 0) = "CELL_1_0"
aryIncompleteOrders(1, 1) = "CELL_1_1"
aryIncompleteOrders(1, 2) = "CELL_1_2"

aryIncompleteOrders(2, 0) = "CELL_2_0"
aryIncompleteOrders(2, 1) = "CELL_2_1"
aryIncompleteOrders(2, 2) = "CELL_2_2"

aryIncompleteOrders(3, 0) = "CELL_3_0"
aryIncompleteOrders(3, 1) = "CELL_3_1"
aryIncompleteOrders(3, 2) = "CELL_3_2"

RetrieveIncompleteOrders = UBound(aryIncompleteOrders, 1) + 1
End Function

=================================================
1 + 1 = 3 for sufficiently large values of 1.

Richard Lewis Haggard



Mon, 08 Apr 2002 03:00:00 GMT  
 Problem passing a variant array out of VBasic object to ASP
For what it's worth, I never did find out what was wrong. I did get it to
work by having the returned value from the function be the desired variant
array but that shouldn't have been required. I suspect that the problem was
a system problem- maybe the VBasic COM object that was being built wasn't
the one that was actually registered in the transaction server. Thanks
anyway.

rlh



Quote:
> I've done something silly here but can't quite figure it out. I sure would
> appreciate it if someone would be good enough to point out the error.

> In an ASP file, I have an empty array. This empty array is passed to a
> VBasic created COM object that fills the array and then that object
returns
> the number of rows it put into the array. That's the theory, anyway. The
> reality is

>     Microsoft VBScript runtime error '800a000d'
>     Type mismatch: 'objBilling.RetrieveIncompleteOrders'

> Here's the code in the calling ASP file (bits have been snipped for
> brevity):

>  Dim aryLogin : aryLogin = Session("s_aryLogin")
>  dim aryIncompleteOrders()
>  dim iIncompleteOrders
>  .
>  .
>   Set objBilling = Server.CreateObject("Checkerboard.CBilling")
>   iIncompleteOrders = objBilling.RetrieveIncompleteOrders( aryLogin,
> aryIncompleteOrders )
>  .
>  .

> Here's the code in the called VBasic CLS file:

> Public Function RetrieveIncompleteOrders(ByVal aryCust As Variant, ByRef
> aryIncompleteOrders() As Variant) As Variant

> ReDim aryIncompleteOrders(0 To 3, 0 To 2)

> aryIncompleteOrders(0, 0) = "CELL_0_0"
> aryIncompleteOrders(0, 1) = "CELL_0_1"
> aryIncompleteOrders(0, 2) = "CELL_0_2"

> aryIncompleteOrders(1, 0) = "CELL_1_0"
> aryIncompleteOrders(1, 1) = "CELL_1_1"
> aryIncompleteOrders(1, 2) = "CELL_1_2"

> aryIncompleteOrders(2, 0) = "CELL_2_0"
> aryIncompleteOrders(2, 1) = "CELL_2_1"
> aryIncompleteOrders(2, 2) = "CELL_2_2"

> aryIncompleteOrders(3, 0) = "CELL_3_0"
> aryIncompleteOrders(3, 1) = "CELL_3_1"
> aryIncompleteOrders(3, 2) = "CELL_3_2"

> RetrieveIncompleteOrders = UBound(aryIncompleteOrders, 1) + 1
> End Function

> =================================================
> 1 + 1 = 3 for sufficiently large values of 1.

> Richard Lewis Haggard



Tue, 09 Apr 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Array to Variant and Variant to array problem

2. Passing Variant Array from ASP to COM Component

3. Passing Variant Array from ASP to COM Component

4. Pass Variant Array to a COM Object

5. Passing a variant array from asp to a cls and back

6. converting Array to Variant and Variant to Array

7. How to pass array from ASP to VB object

8. Passing an Array from a COM Object to an ASP Page

9. Passing array from COM object to ASP

10. Assign Object to Variant and then Variant to Object

11. VB and ASP Class Array Passing Problem

12. Passing variant array to stored procedure

 

 
Powered by phpBB® Forum Software