DBError 1007 Committing changes on mssql

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
aleroot
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 21.02.2013, 22:27

DBError 1007 Committing changes on mssql

Postby aleroot » 21.09.2013, 19:51

Hi,
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;


Why ?
Is it a bug or Am I doing something wrong ?

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

Re: DBError 1007 Committing changes on mssql

Postby EgonHugeist » 25.09.2013, 19:25

What about AutoCommit mode?

Which Connection settings do you use?
King regards, Michael

You want to help? viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image

aleroot
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 21.02.2013, 22:27

Re: DBError 1007 Committing changes on mssql

Postby aleroot » 27.09.2013, 10:45

AutoCommit = True
Protocol = 'mssql'

Others to default ... With other database type (e.g. : PostgreSQL, Mysql) it works without any problem, while on mssql I have the above error.


Return to “ZeosLib 7.0 Stable Forum”

Who is online

Users browsing this forum: No registered users and 1 guest