Oracle Objects for OLE and VB Error 438 
Author Message
 Oracle Objects for OLE and VB Error 438

I'd appreciate assistance in explaining an error encountered when
trying to reference an array of Oracle Obejcts for OLE
recordsets; the problem may have nothing to do with oo4o and may
be strictly a VB question, but perhaps not.

I have two forms; the first calls the second.  In Form_One's
declarations, there is this;

Dim ooors( ) as Object

and ooors( ) is ReDIMensioned and then assigned during the course
of that form's events.

In Form_Two, I want to reference an element in ooors().  This can
be done by FormName, but not by Form(index) as I had hoped to do.
Here's the result of the immediate window:

?Forms(1).name
F_CUSTOMER

?F_CUSTOMER.ooors(1).recordcount
 1

?Forms(1).ooors(1).recordcount  [gets error 438]

Why can't I reference this using
Form(index).ArrayOfObjects(offset).property ?

Thanks for any insights.
Tim



Fri, 09 Mar 2001 03:00:00 GMT  
 Oracle Objects for OLE and VB Error 438

Quote:

>Dim ooors( ) as Object

>and ooors( ) is ReDIMensioned and then assigned during the course
>of that form's events.

>In Form_Two, I want to reference an element in ooors().  This can
>be done by FormName, but not by Form(index) as I had hoped to do.
>Here's the result of the immediate window:

>?Forms(1).name
>F_CUSTOMER

>?F_CUSTOMER.ooors(1).recordcount
> 1

>?Forms(1).ooors(1).recordcount  [gets error 438]

>Why can't I reference this using
>Form(index).ArrayOfObjects(offset).property ?

I could be wrong but I am guessing it is because ooors is declared as
object.  Anytime you do this, VB has to query the IDispatch interface
to find out what you are working with.  When you reference the form by
name, the VB compiler can fill in the object type because it is known
at compile time.  By referencing the Forms collection, the object type
is not known until run time.  Then COM tries to use the iUnknown
interface which VB does not support.

I would suggest two things; first try using early binding on the
object variable and second, make sure you are using one of the newer
versions of OO4O.  I remember some of the older ones did not include a
type library which forced VB to use iDispatch all the time.

HTH
--
Mark Wagoner
To reply, remove no.spam from my e-mail address



Sat, 10 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB Run time error 438 : Object doesn't support this property or method

2. ole 438 error

3. can't insert new recoeds to a query (ole error 438)

4. can't insert new recoeds to a query (ole error 438)

5. Help w/ 438 error object does not support property

6. Object error 438

7. Error 438 - Object doesn't support this property or method

8. DB2 v5.2 - Error 438 object doesn't support this property or method

9. 438 Error (VB 4.0 - 16bit)

10. VB 4.0 Error 438 when Opening Word Doc

11. Automation Error 438 when running a compiled VB program

12. Run-time error 438 - Calling all VB gurus

 

 
Powered by phpBB® Forum Software