Subject | RE: [IBO] TIBOTable.FindNearest |
---|---|
Author | firebird@spence.users.panix.com |
Post date | 2006-07-26T18:42:21Z |
> -----Original Message-----Behalf Of firebird@...
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
> Sent: Wednesday, July 26, 2006 11:43 AMUpon further investigation, I've found the following:
> To: IBObjects@yahoogroups.com
> Subject: [IBO] TIBOTable.FindNearest
>
>
> I have this table:
>
> CREATE TABLE ARINV (
> "Acc ID" INTEGER NOT NULL,
> "Invoice #" VARCHAR(25) NOT NULL,
> "Date" DATE NOT NULL,
> "Sub Total" NUMERIC,
> "Tax" NUMERIC,
> "Freight" NUMERIC,
> "Total" NUMERIC,
>
> ... and some more fields, clipped for brevity
>
> CONSTRAINT PK_ARINV PRIMARY KEY ("Acc ID", "Invoice #", "Date")
> );
>
> This line of code
>
> tblInvoice.FindNearest( [ID, nil, nil] );
>
> throws an exception that says this:
>
> Cannot access index field 'ARINV."Acc ID" '
>
> from within TIBODataset.SetKeyFields.
>
> Does it want a separate index on each of "Acc ID", "Invoice #"
> and "Date"?
>
> Michael D. Spence
> Mockingbird Data Systems, Inc.
>
In TIBODataset.GetIndexField, the string 'ARINV."Acc ID"' is
retrieved from InternalDataset.SQLOrderLinks.IndexNames.
Subsequently, a FindField() call is made, but the field is
named 'Acc ID' and AFAICT, FindField isn't overridden so
it can never match 'Acc ID' to 'ARINV."Acc ID"'.
Is this a bug or am I doing something untoward?
Michael D. Spence
Mockingbird Data Systems, Inc.