SQLite3Connection + SQLQuery, Create table but got nothing... lazarus / 16-Databases ---------------------------------------------------------------------- hanfu · 2012-07-16 02:41 Hi, everybody, i have codes like this: *****************************       SQLQuery.SQL.Text :=         'Create Table PingData (' +         '  ID primary key, ' +         '  LocalIP varchar not null, '+         '  PeerIP varchar not null, ' +         '  Send int not null, '       +         '  Recv int not null, '       +         '  Min_  float not null, '       +         '  Max_  float not null, '       +         '  Avg_  float not null'         +         ')';       SQLQuery.ExecSQL;    ***************************** i hope this can create a table named 'PingData' in my SQLite3 DB, but always got nothing.  The DB file is always 0 bytes.  need your help. Thanks! ---------------------------------------------------------------------- sylvanus67 · 2012-07-16 06:00 Code: [Select] LocalIP varchar not null, '+         '  PeerIP varchar not null, ' + I think varchar needs length. and Code: [Select]ID primary key ID needs type ---------------------------------------------------------------------- Elmug · 2012-07-16 08:06 Actually, hanfu, since an SQLite3 Database is created, the files would never be of 0 bytes length. This means, to me, that first you have to have a Databse created, even if with no tables, it would have some minimum length. Therefore, when and how did you FIRST create a databse? Also, when you create tables with statements, the statements need to be commited. But, again, first make sure you first, you do have a database, and the file should have the .s3db. Otherwise, the file might not be an SQLite3 database. ---------------------------------------------------------------------- Knipfty · 2012-07-19 13:52 Hi hanfu, This link, http://sqlite4fpc.yolasite.com/, does a pretty good job of showing how to create and manipulate tables for SQLite3 in code.  It actually looks like it would work for many types of DB programming. Post back and let me know if it is helpful or not. Knipfty ---------------------------------------------------------------------- wp · 2012-07-20 20:02 I had the same problem as described in the first posting. However, after calling SQLTransaction.Commit after executing the query, the file was ok.