Subject | Re: Getting column reference from TIB_Cursor? |
---|---|
Author | Marco Menardi |
Post date | 2003-04-30T09:04:13Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
automatically FIRST? Since Open for a cursor is a non-sense, and often
people make this mistake, and since they call "open" meaning "first",
changing IBO code will reduce errors and support costs...
regards
Marco Menardi
> At 10:39 PM 29/04/2003 -0700, you wrote:takes
> >Yes, I did, and it won't compile. I get the following error (BCB4):
> >
> >'Fields' is not a member of 'TIB_Row'.
> >
> >Here is my code:
> >
> > ScratchCursorX->Close();
> > ScratchCursorX->SQL->Clear();
> > ScratchCursorX->SQL->Add(thequery);
> > ScratchCursorX->Open();
> > if (ScratchCursorX->Eof)
> > return 0;
> > else
> > return ScratchCursorX->Fields->Fields[0].AsInteger;
> >
> >It's the last line that causes the compile to generate the above error.
>
> Don't call Open on TIB_Cursor. It's a unidirectional cursor so Open
> you nowhere except BOF.Why not change IBO code so that OPEN against a cursor performs
>
> Call First. And remember to test Prepared and call it if not Prepared.
>
automatically FIRST? Since Open for a cursor is a non-sense, and often
people make this mistake, and since they call "open" meaning "first",
changing IBO code will reduce errors and support costs...
regards
Marco Menardi