Hi,
How do one sort with the TMSQuery object, because TADOQuery has a Sort property, but I see that the TMSQuery does now. Please explain...
Thanks.
Sorting TMSQuery
Read on the forum, and got it working:
Code: Select all
procedure Sort_Grid(ACol : Integer; var ASortBy : String; var ADataset : TMSQuery);
var
fldName : String;
begin
if ASortBy = 'ASC' then
ASortBy := 'DESC'
else
ASortBy := 'ASC';
fldName := ADataset.FieldList.fields[ACol].FieldName;
ADataset.IndexFieldNames := fldName +' '+ ASortBy +';';
end;