SQLite and new database lazarus / 16-Databases ---------------------------------------------------------------------- bigeno · 2013-11-06 12:35 I try to start with SQLite but I've one problem at begining. How to creare new empty database from code ? On wiki there is info that I should use SQLite3.exe for this. Is this only way ?! TQLite3Connection have CreateDB procedure but I get "Operation is not supported by this type of database". ---------------------------------------------------------------------- LacaK · 2013-11-06 12:42 IIRC only open TSQLite3Connection. If specified database (file) does not exists it will be created. ---------------------------------------------------------------------- bigeno · 2013-11-06 12:55 Quote from: LacaK on November 06, 2013, 01:42:26 pmIIRC only open TSQLite3Connection. If specified database (file) does not exists it will be created. indeed (empty file was created, size=0), but next problem with create table, if I use   SQLiteLibraryName := 'sqlite3.3.8.1.dll';   SQLite3Connection1.DatabaseName := 'db_nonexist.db';   SQLite3Connection1.Connected := True;   SQLQuery1.SQL.Add(   'CREATE TABLE SAMPLE (' +   ' id INTEGER PRIMARY KEY,' +   ' Name VARCHAR(50)'+   ')');   SQLQuery1.Active:=true; I get "cannot open a non-select statement". ? ---------------------------------------------------------------------- LacaK · 2013-11-06 13:40 Quote from: bigeno on November 06, 2013, 01:55:45 pm  SQLiteLibraryName := 'sqlite3.3.8.1.dll';   SQLite3Connection1.DatabaseName := 'db_nonexist.db';   SQLite3Connection1.Connected := True;   SQLQuery1.SQL.Add(   'CREATE TABLE SAMPLE (' +   ' id INTEGER PRIMARY KEY,' +   ' Name VARCHAR(50)'+   ')');   SQLQuery1.Active:=true; Instead of:   SQLQuery1.Active:=true use:   SQLQuery1.ExecSQL; ---------------------------------------------------------------------- bigeno · 2013-11-06 14:46 Thanks. Now it should go smoothly