Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Objects for OLE and VB Error 438

Re: Oracle Objects for OLE and VB Error 438

From: Mark Wagoner <mwagoner_at_no.spam.iac.net>
Date: 1998/09/22
Message-ID: <36079c66.314103897@news.iac.net>#1/1

On Mon, 21 Sep 1998 16:27:54 -0400, Tim Romano <tim_at_ot.com> wrote:
>
>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
Received on Tue Sep 22 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US