[firebase-br] Configurar sistema para rodar na rede ???
Nilton Oliveira
nillgolv em bol.com.br
Sex Nov 18 01:39:43 -03 2011
Pessoal, meu sistema está todo configurado para rodar na rede e não condigo. informa: 'Não foi possivel conectar ao banco de dados!
uso delphi xe, firebird 2.5;
a rede windows xp está funcionando tudo ok;
firewall do xp está desativado;
No delphi:
na uses do datamodulo coloquei Midaslib
no datamodule:
--------------
var
DataModule1: TDataModule;
BancoDeDados : String;
ArquivoINI : TIniFile;
procedure TDataModule1.sqlConnection1BeforeConnect(Sender: TObject);
const
FileName = 'config.ini';
var
conexao : String;
IniFileName : TIniFile;
begin
IniFileName := TIniFile.Create(ExtractFilePath(ParamStr(0))+FileName);
Try
conexao := Trim(IniFileName.ReadString('Acesso','Database',''));
Finally
IniFileName.Free;
end;
sqlConnection1.ConnectionName := conexao;
end;
procedure TDataModule1.DataModuleCreate(Sender: TObject);
var i : Integer;
begin
if not FileExists(ExtractFilePath(Application.ExeName)+'config.ini') then
begin
ArquivoINI := TIniFile.Create(ExtractFilePath(Application.ExeName)+'config.ini');
ArquivoINI.WriteString('Acesso','Database',(ExtractFilePath(Application.ExeName)+'sistema.fdb'));
BancoDeDados := ArquivoINI.ReadString('Acesso','Database','');
sqlConnection1.ConnectionName := BancoDeDados;
sqlConnection1.Connected := TRUE;
for i := 0 to ComponentCount - 1 do
begin
if Components[i] is TSQLConnection then
(Components[i] as TSQLConnection).Connected := TRUE;
end;
ArquivoINI.Free;
end
else
try
sqlConnection1.ConnectionName := BancoDeDados;
sqlConnection1.Connected := TRUE;
for i := 0 to ComponentCount - 1 do
begin
if Components[i] is TSQLConnection then
(Components[i] as TSQLConnection).Connected := TRUE;
end;
Application.MessageBox('Conexão realizada com sucesso!','CONEXÃO OK');
ArquivoINI.Free;
except
Application.MessageBox('Não foi possivel conectar ao banco de dados!','CONEXÃO FALHOU');
end
end;
no arquivo config.ini:
----------------------
[Acesso]
DriverUnit=DBXFirebird
DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver150.bpl
DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borland.Data.DbxCommonDriver,Version=15.0.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b
MetaDataPackageLoader=TDBXFirebirdMetaDataCommandFactory,DbxFirebirdDriver150.bpl
MetaDataAssemblyLoader=Borland.Data.TDBXFirebirdMetaDataCommandFactory,Borland.Data.DbxFirebirdDriver,Version=15.0.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b
GetDriverFunc=getSQLDriverINTERBASE
LibraryName=dbxfb.dll
VendorLib=fbclient.DLL
Role=RoleName
MaxBlobSize=-1
TrimChar=False
ErrorResourceFile=
ServerCharSet=
drivername=FIREBIRD
blobsize=-1
commitretain=False
localecode=0000
rolename=RoleName
sqldialect=3
isolationlevel=ReadCommitted
waitonlocks=True
trim char=False
Database=servidor:d:\projeto\sistema.fdb
usei também o ip do servidor e nada de funcionar
Database=192.168.1.22:d:\projeto\sistema.fdb
sempre a mesma informação do Application.MessageBox:
'Não foi possivel conectar ao banco de dados!
Onde está o erro ???
A quem possa aguardo ajuda
Grato
Nilton Oliveira
Mais detalhes sobre a lista de discussão lista