Line | |
---|
1 | unit UFormConnection;
|
---|
2 |
|
---|
3 | {$mode delphi}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
---|
9 | maskedit, USqlDatabase;
|
---|
10 |
|
---|
11 | type
|
---|
12 |
|
---|
13 | { TFormConnection }
|
---|
14 |
|
---|
15 | TFormConnection = class(TForm)
|
---|
16 | ButtonConnect: TButton;
|
---|
17 | ButtonCancel: TButton;
|
---|
18 | EditHostName: TEdit;
|
---|
19 | EditUserName: TEdit;
|
---|
20 | EditSchema: TEdit;
|
---|
21 | EditPassword: TEdit;
|
---|
22 | Label1: TLabel;
|
---|
23 | Label2: TLabel;
|
---|
24 | Label3: TLabel;
|
---|
25 | Label4: TLabel;
|
---|
26 | private
|
---|
27 | { private declarations }
|
---|
28 | public
|
---|
29 | procedure LoadFromDatabase(Database: TSqlDatabase);
|
---|
30 | procedure SaveToDatabase(Database: TSqlDatabase);
|
---|
31 | end;
|
---|
32 |
|
---|
33 | var
|
---|
34 | FormConnection: TFormConnection;
|
---|
35 |
|
---|
36 | implementation
|
---|
37 |
|
---|
38 | {$R *.lfm}
|
---|
39 |
|
---|
40 | { TFormConnection }
|
---|
41 |
|
---|
42 | procedure TFormConnection.LoadFromDatabase(Database: TSqlDatabase);
|
---|
43 | begin
|
---|
44 | EditHostName.Text := Database.HostName;
|
---|
45 | EditUserName.Text := Database.UserName;
|
---|
46 | EditPassword.Text := '';
|
---|
47 | EditSchema.Text := Database.Database;
|
---|
48 | end;
|
---|
49 |
|
---|
50 | procedure TFormConnection.SaveToDatabase(Database: TSqlDatabase);
|
---|
51 | begin
|
---|
52 | Database.HostName := EditHostName.Text;
|
---|
53 | Database.UserName := EditUserName.Text;
|
---|
54 | Database.Password := EditPassword.Text;
|
---|
55 | Database.Database := EditSchema.Text;
|
---|
56 | end;
|
---|
57 |
|
---|
58 | end.
|
---|
59 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.