Subject | Re: [IBO] EDatabaseError: Field ID not found in TClientDataSet and TIBOQuery |
---|---|
Author | Helen Borrie |
Post date | 2003-09-11T22:38:43Z |
At 12:21 PM 11/09/2003 +0000, you wrote:
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
>In a simple form, I have a TClientDataSet connected to a TIBOQueryI think that is because the query does not return any database fields.
>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 only want the number of registers via TClientDataSet because II'm curious as to why not..but a dataset component is not wanted here.
>cannot access to TIBOQuery directly.
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