Subject RE: [IBO] AV with ParamByName in DSQL component
Author Leigh J. Worthing
No. I made a dummy variable of AnsiString and assigned
DirQuery->FieldByName("STID")->AsString to it and it worked fine. I just
compiled the blob insert sample because it uses a DSQL component and it has
the same Access Violation at the same memory location. I hope it is not a
quirk with 3.06 Cf and BCB 5.

Leigh

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Saturday, March 03, 2001 2:40 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] AV with ParamByName in DSQL component


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
_______________________________________________________




Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/