I have a strange problem with ZEOS 7.0.5 and SqlServer 2005 using the mssql library, when I try to commit changes i get the error DBError 1007 from SQL Server that says that A Begin Transaction is not called ...
The strange thing is that the record is correctly inserted in the database table despite the error message.
The following code works for postgresql and mysql, but it fails with DBError 1007 on mssql :
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
Conn.StartTransaction;
try
ZQuery1.SQL.Add('INSERT INTO supervisor_key VALUES (:COD, :VAL)');
ZQuery1.ParamByName('COD').AsString := 'AleKey';
ZQuery1.ParamByName('VAL').AsString := 'AleValue';
ZQuery1.ExecSQL;
Conn.Commit
except
Conn.Rollback
end
end;
Is it a bug or Am I doing something wrong ?