Problem with derived sort order
Posted: Thu 16 Oct 2008 10:12
Greetings,
We recently upgraded from 3.80 to 4.50(.0.36) and are experiencing issues with the order of returned queries.
I have traced the problem to the following example scenario:
A clean, newly created TClientDataset is populated from:
" SELECT LastName
FROM Customer
ORDER BY CustomerID, FirstName, LastName "
The DataSet comes back ordered by LastName (not CustomerID and FirstName first). On inspecting the DataSet, I see LastName was somehow added to the DataSet's .IndexFields, but .IndexFieldNames is blank. The dataset should have no explicit sorting - just retain SQL Server's query result record order.
Adding FirstName and CustomerID to the SELECT list 'resolves' the sorting issue. Unfortunately this is not a solution as we have many reports on many implementations.
Is there any way to turn off this behaviour? It worked fine on 3.80.
Please advise.
Thanks,
Carl
We recently upgraded from 3.80 to 4.50(.0.36) and are experiencing issues with the order of returned queries.
I have traced the problem to the following example scenario:
A clean, newly created TClientDataset is populated from:
" SELECT LastName
FROM Customer
ORDER BY CustomerID, FirstName, LastName "
The DataSet comes back ordered by LastName (not CustomerID and FirstName first). On inspecting the DataSet, I see LastName was somehow added to the DataSet's .IndexFields, but .IndexFieldNames is blank. The dataset should have no explicit sorting - just retain SQL Server's query result record order.
Adding FirstName and CustomerID to the SELECT list 'resolves' the sorting issue. Unfortunately this is not a solution as we have many reports on many implementations.
Is there any way to turn off this behaviour? It worked fine on 3.80.
Please advise.
Thanks,
Carl