I use the PACK DATABASE command to encrypt the Access database and am noticing that some queries are returning a ResultSet ordered incorrectly. This appears to have been happening since I updated to a newer release some time ago.
For example:
SELECT columnName
FROM tableName
WHERE floatValue>5
ORDER BY floatValue
Will always return the rows ordered descending, even if I append ASC to the end.
If I do:
SELECT columnName FROM
( SELECT columnName
FROM tableName
WHERE floatValue>5
)
ORDER BY floatValue
then the ResultSet is ordered correctly.
|
Please check whether your tableName has a descending index on floatValue.
|
There was an index on the table but I removed it and it was still a problem.
I think I have fixed it now. The encrypted database was created using a slightly different version of the .jar to the one that was used in my application. Changing the application to use the same .jar file solves the problem.
|