Page 1 of 1

firebird embedded server

Posted: 20.03.2008, 17:19
by slai
Hy what i have to do to connect to an db-file with the firebird embedded server 1.5?

Now i have a datamodule with an ZConnection, what else i have to configure to connect to the dbfile?

i've got an oncreate method on the mainform

Code: Select all

procedure TFrmMain.FormCreate(Sender: TObject);
var
   i : integer;
begin

     try
        DBDataMod := TDBDataMod.Create(nil);
        DBDataMod.ZCDB.Database := ExtractFilePath(Application.ExeName)+'data\POKERTOOLDATA.FDB';
        DBDataMod.ZCDB.Connected := True;

        for i := 0 to DBDataMod.ComponentCount-1 do begin
            if DBDataMod.Components[i].ClassName = 'TZTable' then begin
               TZTable(DBDataMod.Components[i]).Active := True;
            end;
        end;
        berror := false;
     except
           ShowMessage('Konnte nicht zur Datenbank verbinden!'+#13#10+'Das Programm wird geschlossen.');
           berror := True;
     end;
end;   
on the line TZTable(DBDataMod.Components).Active := True; the programm crashes. thanks for replys

i work with lazarus 0.9.22
and zeos 6.6.2-RC

Posted: 20.03.2008, 18:17
by slai
found it... username and passwort must set by default
sysdba
masterkey....