-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathu_dtmconexao.pas
More file actions
54 lines (35 loc) · 874 Bytes
/
Copy pathu_dtmconexao.pas
File metadata and controls
54 lines (35 loc) · 874 Bytes
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
unit U_DtmConexao;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, ZConnection, ZDataset, DB, odbcconn, SQLDB,
MSSQLConn, Forms;
type
{ TDtmConexao }
TDtmConexao = class(TDataModule)
TbsplashRercursosHumanos: TStringField;
zConexao: TZConnection;
ZReadOnlyQuery1Bairro: TStringField;
ZReadOnlyQuery1Cidade: TStringField;
ZReadOnlyQuery1Endereco: TStringField;
ZReadOnlyQuery1Nome: TStringField;
ZReadOnlyQuery1UF: TStringField;
private
public
function abreConexao:Boolean;
end;
var
DtmConexao: TDtmConexao;
implementation
{$R *.lfm}
{ TDtmConexao }
function TDtmConexao.abreConexao: Boolean;
begin
try
zConexao.Connected:= true;
except
Application.MessageBox('Erro ao conectar com o banco de dados. Aplicação será finalizada!', 'Atenção');
Application.Terminate;
end;
end;
end.