OnCustomSQLSyntax
Applies to
TAstaClientSocket
Declaration
type TSQLCustomFormatEvent = procedure(Sender:
TObject;
DS: TDataSet; FieldName: string; var
TheResult: string;
var Handled: Boolean) of
object;
property OnCustomSQLSyntax: TSQLCustomFormatEvent;
Description
This event allows you to
format any field to your specifications. Note that you MUST set the Handled argument to True if you are
overriding the default format that ASTA uses. It is up to you to format the argument TheResult to your
specifications.
procedure
TForm1.AstaClientSocket1CustomSQLSyntax(Sender: TObject;
DS: TDataSet; FieldName: string;
var TheResult: string;
var Handled:
Boolean);
begin
case DS.FieldByName(FieldName).DataType of
ftDate: begin
TheResult := QuotedStr(FormatDateTime(‘DD/MM/YYYY’,
DS.FieldByName(FieldName).AsDateTime)));
Handled := True;
end
end;
end;