diff --git a/components/rx/trunk/exsortzeos.pas b/components/rx/trunk/exsortzeos.pas index 9f9f31235..1c138998a 100644 --- a/components/rx/trunk/exsortzeos.pas +++ b/components/rx/trunk/exsortzeos.pas @@ -54,9 +54,10 @@ uses ZDbcIntfs, ZVariant; function FixFieldName(S:string):string;inline; begin - if Pos(' ', S)>0 then - S:='"'+S+'"'; - Result:=S; + if not IsValidIdent(S) then + Result:='"'+S+'"' + else + Result:=S; end; procedure TZeosDataSetSortEngine.Sort(FieldName: string; ADataSet: TDataSet;