This is an old post but I run into the following. If I use the sort function of the gridreference page then that works fine as long as I retrieve all records. Now I have a query that retrieves data that needs to be exported, so I eventually need all the records. Because retrieving all records is slow, I thought to use PacketRecords:= 100. But then the sorting function no longer works. I get an access violation on the line
AddIndex(ASC_IndexName,column.FieldName,[]);
I suspect this is because I only pull part of the data to me and part is still on the server. Is there a way to sort a dbgrid and using PacketRecords? I can not use 'sort by' in the query. I want to be able to sort columns when i click on the title of the dbgrid