Subject TIB_Cursor & FieldByName V4.2.I
Author sdbeames
Hi,
when using a TIB_Cursor to select a single row from a table, my
calls to FieldByName don't return the retrieved values. TIB_Monitor
shows the correct values ARE being retrieved. I have a handler for
IB_Cursor1AfterFetchRow(), because I use this cursor to fill some
TComboBoxes as well, but it checks a flag and does nothing for this
call.

DMod->IB_DSQL1->SQL->Clear();
DMod->IB_DSQL1->SQL->Add("Select * from HDRS where CAT3NO
= :Cat3No");
DMod->IB_DSQL1->ParamByName("Cat3No")->AsInteger = 3791;
DMod->IB_DSQL1->ExecSQL();
int i = DMod->IB_DSQL1->FieldByName("HDR_ID1")->AsInteger,
j = DMod->IB_DSQL1->FieldByName("HDR_ID2")->AsInteger;

THIS PRODUCES i = 1, j = 2


IB_Cursor1->SQL->Clear();
IB_Cursor1->SQL->Add("Select * from HDRS where CAT3NO = :Cat3No");
IB_Cursor1->ParamByName("Cat3No")->AsInteger = 3791;
IB_Cursor1->First();
i = IB_Cursor1->FieldByName("HDR_ID1")->AsInteger;
j = IB_Cursor1->FieldByName("HDR_ID2")->AsInteger;

THIS PRODUCES i = 0, j = 0

The monitor o/p is ...
FETCH
STMT_HANDLE = 16605124
FIELDS = [ Version 1 SQLd 6 SQLn 6
HDRS.CAT3NO = 3791
HDRS.HDR_ID1 = 1
HDRS.HDR_ID2[HDR_ID2] = 2
HDRS.HDR_ID3 = <NULL>
HDRS.HDR_ID4 = <NULL>
HDRS.HDR_ID5 = <NULL> ]

What am I forgetting?

Thanks,
Steve