SQL Order By Problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
DJK
Posts: 5
Joined: Sun 23 May 2010 21:17

SQL Order By Problem

Post by DJK » Sun 23 May 2010 21:22

I am using Delphi 2010 with the Mydac components to connect to my online mysql database. The problem Im having is the following..

I am connecting my table to the mydatasource1 which in turn is connected to the mytable1.

The mytable1 when I double click I have under the 'order by' part the text 'points desc'. This results in the sql string

"select * from mytable order by points desc"

Problem is while it fetches my data just fine, it doesn't order by the points field as it should :( Any ideas why this is happening ?

Thanks.

DJK
Posts: 5
Joined: Sun 23 May 2010 21:17

Post by DJK » Sun 23 May 2010 21:26

Addendum. I just tried using a "myquery1" instead of a "mytable1" and this DOES order the table correctly. So while I can fix it this way I still think it's weird mytable behaves ackward....

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 25 May 2010 12:03

I can not reproduce the problem. Please make sure that the MyTable.IndexFieldNames property is empty.

Post Reply