Page 1 of 1

Sort with TCRDBGrid

Posted: Mon 14 Jul 2008 16:28
by deca
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

Posted: Tue 15 Jul 2008 05:58
by Antaeus
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.

Posted: Tue 15 Jul 2008 08:09
by deca
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.

Posted: Tue 15 Jul 2008 09:40
by Antaeus
Try to download and install the latest build of MyDAC (5.50.0.36). This problem should be fixed in it.

Posted: Tue 15 Jul 2008 10:38
by deca
Thanks, the update has fixed the problem.

DECA