Topic: save the contents of a tabble grid to a text file
How can I save the contents of a tabble grid to a text file.
My Visual Database → Script → save the contents of a tabble grid to a text file
How can I save the contents of a tabble grid to a text file.
Hello iwkom
procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
Form1.TableGrid1.SaveToTextFile('d:\file.txt'); // stocke les données dans le fichier comme une colonne de séparation, utilisé une virgule
end;
To save it to a file XML via a dialog box :
procedure Form1_Button7_OnClick (Sender: string; var Cancel: boolean);
var Results: TDataSet;
SaveDialog : TSaveDialog;
begin
SaveDialog := TSaveDialog.Create(Form1);
If SaveDialog.Execute then
Begin
SQLQuery('SELECT FirstName, LastName FROM person', Results);
DataSetToXML(Results,(SaveDialog.FileName + '.xml'));
Results.Free;
end;
end;
JB
Sincere thanks.
And how can I add free text at the end, for example from a text field
My Visual Database → Script → save the contents of a tabble grid to a text file
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi