Passing a variant array from asp to a cls and back 
Author Message
 Passing a variant array from asp to a cls and back

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 aryIncompleteOrders()
 dim iIncompleteOrders
  Set objBilling = Server.CreateObject("Checkerboard.CBilling")
  iIncompleteOrders = objBilling.RetrieveIncompleteOrders( aryLogin,
aryIncompleteOrders )

Here's the code in the called CLS file:

Public Function RetrieveIncompleteOrders(ByVal aryCust As Variant, ByRef
aryIncompleteOrders() As Variant) As Variant
Dim db As Database.CDatabase
Dim adoConn As ADODB.Connection
Dim adoRs As ADODB.Recordset

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  
 Passing a variant array from asp to a cls and back
Change the


Quote:
> 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.
>     Microsoft VBScript runtime error '800a000d'
>     Type mismatch: 'objBilling.RetrieveIncompleteOrders'

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

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

> Public Function RetrieveIncompleteOrders(ByVal aryCust As Variant,

ByRef aryIncompleteOrders() As Variant) As Variant

In the function definition, change the parameter definition for
aryIncompleteOrders from an array to a variant.

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

--
Kirk Allen Evans

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 15 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing Variant Array from ASP to COM Component

2. Passing Variant Array from ASP to COM Component

3. Problem passing a variant array out of VBasic object to ASP

4. Passing array from ASP (VBScript) to DLL and back

5. converting Array to Variant and Variant to Array

6. Passing Array to Session Variable Then back to Array

7. Array to Variant and Variant to array problem

8. Convert user defined type or variant to byte array (and back)

9. Variant to Byte Array, and back

10. How to get back an array of struct via a variant fron VC++ ATL to VB

11. Variant to Byte Array, and back

12. Nested variant array to string and back?

 

 
Powered by phpBB® Forum Software