Firebird Embedded
Posted: Thu 10 Nov 2016 13:19
Hi All,
with this code, I use Firebird embedded for my application leaving server blank:
with ServerConn do
begin
if(Connected) then Disconnect;
ProviderName:=ConnIni.ReadString('fbconnection','ProviderName','');
// server:=ConnIni.ReadString('fbconnection','server','');
// port := ConnIni.ReadInteger('fbconnection','port',0);
password:='masterkey';
username:='SYSDBA';
Database:=ExtractFilePath(Application.ExeName)+'Data\'+ConnIni.ReadString('fbconnection','database','');
SpecificOptions.Values['ClientLibrary'] := 'fbclient.dll';
end;
ServerConn.Connect;
In this way, I use a local database.
I have problems with this code:
with aq do
begin
edit;
FieldByName('eurocoworking').AsFloat:=euroCow;
FieldByName('Numgiorni').AsFloat:=NumGiorni;
FieldByName('PerceCoworking').AsFloat:=perceCOw;
FieldByName('eurocoworking').AsFloat:=euroCow;
FieldByName('costozero').AsFloat:=COstozero;
FieldByName('percericarico').AsFloat:=perceRic;
FieldByName('imporicarico').AsFloat:=Imporicarico;
FieldByName('costoalcliente').AsFloat:=costoAlCLiente;
try
begin
Connection.StartTransaction;
post;
Connection.Commit;
end;
except on E: Exception do
begin
if(Connection.InTransaction) then
Connection.Rollback;
end;
end;
end;
On connection.starttransaction I have an exception: Can't perform operation on active transaction.
With Firebird embedded, I don't need transaction?
Can you help me?
Thanks, Flavio
with this code, I use Firebird embedded for my application leaving server blank:
with ServerConn do
begin
if(Connected) then Disconnect;
ProviderName:=ConnIni.ReadString('fbconnection','ProviderName','');
// server:=ConnIni.ReadString('fbconnection','server','');
// port := ConnIni.ReadInteger('fbconnection','port',0);
password:='masterkey';
username:='SYSDBA';
Database:=ExtractFilePath(Application.ExeName)+'Data\'+ConnIni.ReadString('fbconnection','database','');
SpecificOptions.Values['ClientLibrary'] := 'fbclient.dll';
end;
ServerConn.Connect;
In this way, I use a local database.
I have problems with this code:
with aq do
begin
edit;
FieldByName('eurocoworking').AsFloat:=euroCow;
FieldByName('Numgiorni').AsFloat:=NumGiorni;
FieldByName('PerceCoworking').AsFloat:=perceCOw;
FieldByName('eurocoworking').AsFloat:=euroCow;
FieldByName('costozero').AsFloat:=COstozero;
FieldByName('percericarico').AsFloat:=perceRic;
FieldByName('imporicarico').AsFloat:=Imporicarico;
FieldByName('costoalcliente').AsFloat:=costoAlCLiente;
try
begin
Connection.StartTransaction;
post;
Connection.Commit;
end;
except on E: Exception do
begin
if(Connection.InTransaction) then
Connection.Rollback;
end;
end;
end;
On connection.starttransaction I have an exception: Can't perform operation on active transaction.
With Firebird embedded, I don't need transaction?
Can you help me?
Thanks, Flavio