Subject Re: [IBO] AV with ParamByName in DSQL component
Author Helen Borrie
At 01:15 PM 03-03-01 -0500, you wrote:
>I am using 3.6Cf with BCB 5. I am trying to use a DSQL component to insert
>a record into a table. I am using the following SQL statement:
>INSERT INTO BPCSTUDENT (STID, LNAME, FNAME, MI,
> FNAME_P, LNAME_P, PHONE, PHONE_H, GR, RETAINED,
> SEX, NAME, CITYSTATE, PARENT, LASTFIRST,
> STREETADD, RACE)
>VALUES (?stid, ?lname, ?fname, ?mi,
> ?fname_p, ?lname_p, ?phone, ?phone_h, ?gr, 'F',
> ?sex, ?name, ?citystate, ?parent, ?lastfirst,
> ?streetadd, ?race)
>
>in the DSQL editor the statement prepares and executes (it inserts a blank
>record). In code I prepare the statement then issue the following line:
>BPCStu->ParamByName("STID")->AsString =
>DirQuery->FieldByName("STID")->AsString; I get a Access Violation of some
>address 42495408.
>
>BPCStu is the TIB_DSQL component and DirQuery is a TIB_QUERY component.
>
>This is the first time I have used the DSQL component. What am I doing
>incorrectly?

Is DirQuery somehow getting closed before the assignment?

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________