0% found this document useful (0 votes)
58 views3 pages

Delphi SQL Export Tool Overview

This document contains code for an application that exports data from selected tables in an ABS database to SQL scripts. It includes code to retrieve the list of tables, select tables for export, set export options, export the selected tables to a string list or file, and event handlers for the user interface controls.

Uploaded by

Paul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views3 pages

Delphi SQL Export Tool Overview

This document contains code for an application that exports data from selected tables in an ABS database to SQL scripts. It includes code to retrieve the list of tables, select tables for export, set export options, export the selected tables to a string list or file, and event handlers for the user interface controls.

Uploaded by

Paul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

unit Main;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, ExtCtrls, ABSMain, DB;

const
DataBaseFileName: String = '..\..\Data\[Link]';

type
TForm1 = class(TForm)
lvTables: TListView;
dlgSave: TSaveDialog;
GroupBox2: TGroupBox;
Label1: TLabel;
reExportToSql: TRichEdit;
GroupBox1: TGroupBox;
cbAddDropTable: TCheckBox;
cbStructure: TCheckBox;
cbData: TCheckBox;
cbBlobSettings: TCheckBox;
cbFieldNamesInInsert: TCheckBox;
btnExpotrAsSqlToScreeen: TButton;
btnExpotrAsSqlToFile: TButton;
Label2: TLabel;
Label3: TLabel;
dbDemos: TABSDatabase;
tblTable: TABSTable;
procedure btnExpotrAsSqlToScreeenClick(Sender: TObject);
procedure btnExpotrAsSqlToFileClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure cbStructureClick(Sender: TObject);
procedure cbDataClick(Sender: TObject);
private
procedure ExportSelectedTablesToSQL(SQL: TStrings);
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

{ TForm1 }

procedure [Link];
var
I: Integer;
begin
with [Link] do
begin
Structure := [Link];
AddDropTable := [Link];
BlobSettings := [Link];
Data := [Link];
FieldNamesInInserts := [Link];
end;
[Link];
for I := 0 to [Link] - 1 do
if [Link][I].Checked then
begin
[Link] := [Link][I].Caption;
[Link]([Link]);
end;
end;

procedure [Link](Sender: TObject);


begin
ExportSelectedTablesToSQL([Link]);
end;

procedure [Link](Sender: TObject);


var
SQL: TStrings;
begin
if [Link] then
begin
SQL := [Link];
try
ExportSelectedTablesToSQL(SQL);
[Link]([Link]);
finally
[Link];
end;
[Link] := 'Script saved to file: ' + [Link];
end;
end;

procedure [Link](Sender: TObject);


var
Tables: TStrings;
begin
[Link] := ExtractFilePath([Link]) +
DataBaseFileName;
Tables := [Link];
try
[Link](Tables);
[Link];
while [Link] > 0 do
begin
with [Link] do
Caption := Tables[0];
[Link](0);
end;
finally
[Link];
end;
end;

procedure [Link](Sender: TObject);


begin
[Link] := [Link];
[Link] := [Link];
end;

procedure [Link](Sender: TObject);


begin
[Link] := [Link];
end;

end.

You might also like