[Lazarus] SQLTransaction won't start

Petr Hlozek petr at ok2cqr.com
Fri Mar 14 18:37:46 CET 2014


It's the name of database. My testing database is called "test". I
posted the table create command to infom about db engine I use for it.

Petr

2014-03-14 17:25 GMT+01:00 Marc Santhoff <M.Santhoff at web.de>:
> On Fr, 2014-03-14 at 12:20 +0100, Petr Hlozek wrote:
>> Hi,
>>
>> I use TMySQL55Connection, TSQLTransaction and TSQLQuery. I always get
>> Transaction is NOT active.
>>
>> here is the code:
>>
>> procedure TForm1.Button1Click(Sender: TObject);
>> var
>>   db : TMySQL55Connection;
>>   q  : TSQLQuery;
>>   tr : TSQLTransaction;
>> begin
>>   db := TMySQL55Connection.Create(nil);
>>   q  := TSQLQuery.Create(nil);
>>   tr := TSQLTransaction.Create(nil);
>>   try try
>>     db.DatabaseName := 'test';
>
> Here you ask for table "test".
>
>>
>> CREATE TABLE test_table (
>
> And here you create a table named "test_table".
>
> Change the table name on creation or ask for the correct name could be
> it.
>
>>   id bigint NOT NULL AUTO_INCREMENT PRIMARY KEY,
>>   myfield varchar(100) DEFAULT ''
>> ) ENGINE='InnoDB' COLLATE 'utf8_bin';
>
> --
> Marc Santhoff <M.Santhoff at web.de>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



-- 
http://HamQTH.com/ok2cqr
http://ok2cqr.com
http://cqrlog.com
http://cqrtest.com




More information about the Lazarus mailing list