-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit2.pas
60 lines (45 loc) · 1.14 KB
/
Unit2.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, UniProvider,
InterBaseUniProvider, Data.DB, DBAccess, Uni, Vcl.Mask, Vcl.ExtCtrls;
type
TForm2 = class(TForm)
koneksi: TUniConnection;
InterBaseUniProvider1: TInterBaseUniProvider;
btnkonek: TButton;
Memo1: TMemo;
EDDB: TLabeledEdit;
procedure btnkonekClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.btnkonekClick(Sender: TObject);
begin
if koneksi.Connected then
koneksi.Connected := false ;
koneksi.Database := eddb.Text ;
koneksi.Username := 'SYSDBA';
koneksi.Server := '';
koneksi.Password := 'masterkey';
koneksi.SpecificOptions.Values['InterBase.ClientLibrary'] := GetCurrentDir + '\fbclient.dll';
try
koneksi.Connected := true ;
if koneksi.Connected then
begin
Memo1.Lines.Add('terkoneksi');
end;
except on e:Exception do
begin
Memo1.Lines.Add('gagal '+ e.Message);
end;
end;
end;
end.