Fórum Erro com conexão do Delphi com Firebird #526289
20/07/2015
0
DBX Error : Driver Could not be properly Initialized.
Client library may be missing, not installed properly,
of the wrong version, or the drive may be missing
from the system path.
O que poderia fazer para resolver ?
Halyfer Cerneski
Curtir tópico
+ 0Posts
20/07/2015
Mateus Carvalho
Gostei + 0
21/07/2015
Halyfer Cerneski
Gostei + 0
24/07/2015
Raimundo Pereira
FDCONNECTION
FDPHYSFBDRIVELINK
USES >> INIFILES
var vArquivo:TIniFile;
Caminho_CONF:string;
begin
Caminho_CONF:=(ExtractFilePath(Application.ExeName) +'CNX.Ini');
if not (FileExists(Caminho_CONF)) then
begin
ShowMessage('Arquivo de conexão com o banco de dados não localizado.');
Application.Terminate;
end
else
begin
vArquivo:=TiniFile.Create(ExtractFilePath(Application.ExeName) +'CNX.Ini');
DM.CNX_PRINCIPAL.Connected:=FALSE;
DM.CNX_PRINCIPAL.Params.Values['Database']:=vArquivo.ReadString('CNX_BD','DATABASE','');
DM.CNX_PRINCIPAL.Params.Values['VedorLib']:=vArquivo.ReadString('CNX_BD','VENDOR_LIB','');
DM.CNX_PRINCIPAL.Params.Values['UserName']:=vArquivo.ReadString('CNX_BD','USERNAME','');
DM.CNX_PRINCIPAL.Params.Values['Password']:=vArquivo.ReadString('CNX_BD','PASSWORD','');
CAMINHO_BANCO:=vArquivo.ReadString('PARAM','CAMINHO_BANCO','');
IF NOT FileExists(CAMINHO_BANCO) then
BEGIN
ShowMessage('BANCO DE DADOS NÃO LOCALIZADO >>'+CAMINHO_BANCO);
Application.Terminate;
END
ELSE
BEGIN
TRY
DM.CNX_PRINCIPAL.Connected:=TRUE;
EXCEPT
if DM.CNX_PRINCIPAL.Connected=FALSE then
BEGIN
ShowMessage('Falha na conexão com o banco de dados.');
END
ELSE
BEGIN
BAR.Panels[0].Text:='CONETADO:'+DateTimeToStr(NOW);
END;
END;
if DM.CNX_PRINCIPAL.Connected=FALSE then
BEGIN
ShowMessage('Falha na conexão com o banco de dados.');
END
ELSE
BEGIN
BAR.Panels[0].Text:='CONETADO UC :'+DateTimeToStr(NOW);
END;
end;
end;
end;
Gostei + 0
24/07/2015
Cleverson.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)