IndexFieldNames get Error

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mysqluser
Posts: 27
Joined: Fri 17 Nov 2006 11:48

IndexFieldNames get Error

Post by mysqluser » Fri 01 Dec 2006 02:32

hello

if i set

MyQuery->IndexFieldNames = "Age ASC";

i get sometimes the error: "Field Age not found". Any idea why?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 01 Dec 2006 13:37

MyDAC performs local sorting by the field which is specified by the IndexFieldNames property. If the field named Age exists in the server table, but it is not requested to the client, MyDAC is unable to find this field to perform sorting. So, error with such message is raised. There are to ways to solve this problem:
- to add the Age field name to the field list reqested from the server;
- to forse sorting on the server by adding ORDER BY clause to the SELECT statement.

mysqluser
Posts: 27
Joined: Fri 17 Nov 2006 11:48

Post by mysqluser » Fri 01 Dec 2006 21:11

thanks Antaeus

Post Reply