Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- uses
- Forms,
- Unit1 in 'Unit1.pas' {Form1};
- {$R *.res}
- begin
- Application.Initialize;
- Application.MainFormOnTaskbar := True;
- Application.CreateForm(TForm1, Form1);
- if Form1.Init then
- Application.Run;
- end.
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ZConnection;
- type
- TForm1 = class(TForm)
- procedure FormCreate(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- private
- FConnection: TZConnection;
- { Private-Deklarationen }
- public
- function Init: Boolean;
- { Public-Deklarationen }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- FConnection := TZConnection.Create(Self);
- end;
- procedure TForm1.FormDestroy(Sender: TObject);
- begin
- FConnection.Free;
- end;
- function TForm1.Init: Boolean;
- begin
- FConnection.HostName := ;
- FConnection.Port := ;
- FConnection.Database := ;
- FConnection.User := ;
- FConnection.Password := ;
- FConnection.Protocol := 'postgresql';
- FConnection.Connected := True;
- Result := False;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement