Subject Re: EDatabaseError: Field ‘ID’ not found in TClientDataSet and TIBOQuery
Author kokok_kokok
I cannot use TIBOQuery directly because I am using a 3 tier system.
The TIBOQuery's are in the middle tier and they are connected to
TClientDataSet (client tier) by DCOM interface. From the client
application, I do not have access to TIBOQuery's directly.

Also, I cannot use TIB_DSQL because TClientDataSet needs a TDataSet
descendant.

The thing is that if I use a TQuery from BDE, all works fine.

Thanks




--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 12:21 PM 11/09/2003 +0000, you wrote:
>
> >In a simple form, I have a TClientDataSet connected to a TIBOQuery
> >via TDataSetProvider.
> >
> >The SQL in TIBOQuery is only "SELECT COUNT(*) FROM TABLE1"
> >
> >When I call ClientDataSet.Open, the message "EDatabaseError:
> >Field `ID' not found" appears. ID is the primary key of the TABLE1.
> >This error is thrown in TIBODataSet.PSGetIndexDefs function. I
> >suppose that IBO is trying find the index field but does not find
it,
> >but in fact, I think that is not necessary.
>
> I think that is because the query does not return any database
fields.
>
>
> >I only want the number of registers via TClientDataSet because I
> >cannot access to TIBOQuery directly.
>
> I'm curious as to why not..but a dataset component is not wanted
here.
>
> The proper way to fire this query (a singleton with no database
fields) is
> with a TIB_DSQL. Check for Prepared and then call its Execute
> method. Read MyQuery.Fields[0].AsInteger to get the result.
>
> Helen