[Lazarus] SQLTransaction won't start
Marc Santhoff
M.Santhoff at web.de
Fri Mar 14 17:25:48 CET 2014
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>
More information about the Lazarus
mailing list