procedure TForm1.Create_Log;
var
f:TextFile;
s:String;
begin
AssignFile(f,ExtractFilePath(Application.ExeName)+'/Log/'+FormatDateTime('yyyymmdd',Now)+'.log');
if not DirectoryExists(ExtractFilePath(Application.ExeName)+'/Log') then
CreateDir(ExtractFilePath(Application.ExeName)+'/Log')
else if not FileExists(ExtractFilePath(Application.ExeName)+'/Log/'+FormatDateTime('yyyymmdd',Now)+'.log') then
ReWrite(F)
else if Form3<>nil then
begin
s:='['+Form3.Edit1.Text+']: '+FormatDateTime('yyyy-mm-dd hh:mm:ss',now);
Append(F);
Writeln(F,s);
s:=DataModule1.ADODataSet1.CommandText;
Writeln(F,'--'+s);
Closefile(F);
end;
end;