Subject AV with ParamByName in DSQL component
Author Leigh J. Worthing
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?

Leigh


[Non-text portions of this message have been removed]