Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2023-02

create table doesn't store

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Larry Dalton
Using Lazarus 2.2 ORC1-fpc-e.w.w-win64,
Windows 11
Microsoft Access 64 bit
procedure TAccess_form.ExcelTestButtonClick(Sender: TObject);
var create_string:string;
begin
 ExcelTestQuery.Close;
 ExcelTestQuery.SQL.Clear;
 create_string:='CREATE TABLE TEST_TABLE';
 ExcelTestQuery.SQL.Append(create_string);
 create_string:='[CUSTOMER STRING(40)]';
 ExcelTestQuery.SQL.Append(create_string);
 Memo1.Lines:=ExcelTestQuery.SQL;
 ExcelTestQuery.ExecSQL;
end;

This code says it creates TEST_TABLE, but it doesn't store it in the database.
If I click the button once, it apparently creates the table. If I then click it the second time, it gives me an error code that the table exists.
If I close the application and look in the database, it doesn't exist. Then if I open the application again,it lets me create it again. Why is it not storing the table in the database?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230209/ea63a4d6/attachment.htm>

Reply by email

gabor
to Larry Dalton

W dniu 2023-02-09 o?16:32, Larry Dalton via lazarus pisze:

Show quoted text 9 lines
This code says it creates TEST_TABLE, but it doesn't store it in the database. If I click the button once, it apparently creates the table. If I then click it the second time, it gives me an error code that the table exists. If I close the application and look in the database, it doesn't exist. Then if I open the application again,it lets me create it again. Why is it not storing the table in the database?

Maybe you should commit transaction after creating table?

Micha?.

Reply by email

Larry Dalton
to gabor

That worked, Michal. Thanks!

Sent from my iPhone

Show quoted text 18 lines
On Feb 9, 2023, at 10:42, gabor via lazarus wrote: ?W dniu 2023-02-09 o 16:32, Larry Dalton via lazarus pisze: > This code says it creates TEST_TABLE, but it doesn't store it in the database. > If I click the button once, it apparently creates the table. > If I then click it the second time, it gives me an error code that the table exists. > If I close the application and look in the database, it doesn't exist. > Then if I open the application again,it lets me create it again. > Why is it not storing the table in the database? Maybe you should commit transaction after creating table? Micha?. -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

Reply by email