[fpc-pascal] How to insert a record and get the primary key with sqldb?
Marcos Douglas
md at delfire.net
Sat Oct 22 17:23:38 CEST 2011
On Sat, Oct 22, 2011 at 11:21 AM, <michael.vancanneyt at wisa.be> wrote:
>
>>
>> DBComm.SQLTransaction.StartTransaction; <-- Fails here with
>> "transaction already active"
>
> Correct. The default transaction is made active after connecting.
> You should call StartTransaction on this transaction only after a commit or
> rollback.
I also found this problem when I migrated from Zeos to SQLdb.
Only SQLdb works in this way. IMHO, it not make sense.
For automatic transactions, the user can define AutoCommit=True If it
is False, I can call StartTransaction BEFORE the Commit. That is the
way that all libs work.
Marcos Douglas
More information about the fpc-pascal
mailing list