Subject How to access fields from the current row of a tib_query
Author Mark Lawes
Basically I am trying to get a grip of how IBObjects work so I can decide if its the tool for me.

I am probably being stupid but I am trying to extract a field from a tib_cursor row and having problems getting the correct data returned.

This is a snippet of code

Var
MyObjid as Int64;

With tib_cursor1 do
begin
Sql.Clear;
Sql.Add('Select objid from table_accounts where account_name = :AccName');
Prepare;
Params.ParamByName('account_name').AsString:='MYACCOUNT';
Execute;
If Active then { Also tried Rowselected>0 which works fine as a test }
begin
FetchFirst; {or FetchAll or BufferFirst - Get data into the buffer }
MyObjid:=FieldByName('OBJID').AsInt64;
{ The objid returned is always zero which is incorrect }
++++++++++++++++++++++++++++++++++++++++++
{ Do More Stuff }
..
..
end;
close;
end;

Basically all I am trying to do is read fields from the current row of the TIB_CURSOR. In this instance I know its a singleton but its essentially the active row I am after. I have looked though the examples for a demo of how this might be done but there are no examples I can find that show this and the help gives no examples either. It looks from the help as though this should work but I am obviously missing something. Probably blindingly obvious once someone points it out.

In this instance I am just doing an existence check so I can warn the user if the account exists before I overwrite it. There are no doubt other ways to achieve the same ends but I need to know how to read data from fields to variables.

Thanks

Mark

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