Board index » delphi » HOW DOES THE SORT METHOD WORKS IN ADO

HOW DOES THE SORT METHOD WORKS IN ADO

HI EVERY BODY

I WAS TRYING TO USE THE SORT METHOD FOUND IN ADO RECORDSETS , BUT I
WANTED TO KNOW IF IT HAS A GOOD ALTERNATIVE, OR ITS BETTER TO USE AN
ORDER BY CLAUSE INSTEAD.

THANKS FOR YOUR HELP

 

Re:HOW DOES THE SORT METHOD WORKS IN ADO


Quote
>I WAS TRYING TO USE THE SORT METHOD FOUND IN ADO RECORDSETS , BUT I
>WANTED TO KNOW IF IT HAS A GOOD ALTERNATIVE, OR ITS BETTER TO USE AN
>ORDER BY CLAUSE INSTEAD.

Sort works find with MS SQL  I haven't used it enough with any of the other
providers to comment.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:HOW DOES THE SORT METHOD WORKS IN ADO


  In my experience (for MSSQL7) if you choose ISO or English
character set for your server, the SORT method works correctly.
But we are using Central European character set -
Croatian sort order, and we must use ORDER BY. The SORT method
sorts wrong.

  Robi

Quote
ABC <AB...@USA.NET> wrote:
>HI EVERY BODY

>I WAS TRYING TO USE THE SORT METHOD FOUND IN ADO RECORDSETS , BUT I
>WANTED TO KNOW IF IT HAS A GOOD ALTERNATIVE, OR ITS BETTER TO USE AN
>ORDER BY CLAUSE INSTEAD.

>THANKS FOR YOUR HELP

Re:HOW DOES THE SORT METHOD WORKS IN ADO


The sort property only applies to client-side cursors.  Because of this, it
will work consistently regardless of database provider.  With a client-side
cursor, all of the records are copied into the client's memory.  So the sort
property will simply sort the in-memory copy of the recordset.  I have a
sense that if you already have an index on the server, you would probably
get better performance using it with an "order by" clause.  One more thing,
ADO will build a temporary index on the sort; so subsequent "locates" might
internally use this index and perform better.

Re:HOW DOES THE SORT METHOD WORKS IN ADO


Hi,

Quote
> I WAS TRYING TO USE THE SORT METHOD FOUND IN ADO RECORDSETS , BUT I
> WANTED TO KNOW IF IT HAS A GOOD ALTERNATIVE, OR ITS BETTER TO USE AN
> ORDER BY CLAUSE INSTEAD.

I think that most import to sort is that you can use it to resort records
without re-executing SQL statement. For example you can make DBGrid to sort
records when user click on title.

Thanks,

Miro.

Other Threads