
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