Margaret,
The Connect2SQL() method should be called from within a method of the objDataType class, such as the init(). See below...
>Here's the code I run from the command line
>
>
>public goapp
>goapp = newOBJECT("appmanager","appmgr.fxp")
>set proc to objdatatype additive
>oDataType = createOBJECT('objDataType')
>
>
>The 'invalid subscript reference' pops up on the 3rd line shown below when the objdatatype tries to go to goapp.
>
>
>DEFINE CLASS ObjDataType AS CUSTOM
> lnConn = 0
procedure init
> this.lnConn = goApp.Connect2SQL('CHROMM')
endproc
...
enddefine
>
>
>If I run the exact same line from the command prompt I get a positve value in lnConn (I have an sqlconnection) and no error message.
Steve Gibson