Sort with TCRDBGrid

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
deca
Posts: 19
Joined: Thu 05 Apr 2007 13:36
Location: Germany

Sort with TCRDBGrid

Post by deca » Mon 14 Jul 2008 16:28

Hello @ all,

i use the mentioned grid in my application. When I click on the column title it has to sort the dataset. In this grid I have predefined some static columns to show them in the grid. The optionsEx are set to dgeEnableSort = true.

My problem is that when I click on a column title I become an exception with my SQL query to check the syntax. But I have no entry point to debug this exception. It is the same sql query as I connect to the database.

What can I do?

Thanks, DECA

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

Post by Antaeus » Tue 15 Jul 2008 05:58

I could not reproduce the problem.
Please send me a complete small sample at mydac*crlab*com to demonstrate it, including script to create and fill table.

Also supply the following information:
- the exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor;
- the exact version of your IDE;
- the exact version of MySQL server and client. You can see it in the Info sheet of TMyConnection Editor.

deca
Posts: 19
Joined: Thu 05 Apr 2007 13:36
Location: Germany

Post by deca » Tue 15 Jul 2008 08:09

I made some more tests and found out that the sql string is wrong.
This is my origin sql string I give to the mydac:
SELECT * FROM myTable WHERE myField LIKE ""

After the sorting the string looks like that:

SELECT * FROM myTable ORDER BY 3 WHERE myField LIKE ""

The point is that the ORDER BY clause is setting on the wrong position.

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

Post by Antaeus » Tue 15 Jul 2008 09:40

Try to download and install the latest build of MyDAC (5.50.0.36). This problem should be fixed in it.

deca
Posts: 19
Joined: Thu 05 Apr 2007 13:36
Location: Germany

Post by deca » Tue 15 Jul 2008 10:38

Thanks, the update has fixed the problem.

DECA

Post Reply