TSQLquery.CreateDataSet raises the error "SQL statement not set" lazarus / 16-Databases ---------------------------------------------------------------------- dpap · 2025-01-10 14:41 I'm tying to cretate a table in a SQLite database usisnf a TSQLquery component with some fieldDefinitions. I use SQLquery1.CreateDataSet but I receive the error in theme. I supposed that defining the fields was enough. What is my error ? The help says "CreateDataset uses the FieldDefs and Fields properties to determine which property contains the structure for the dataset". So why wants the SQL statement? ---------------------------------------------------------------------- cdbc · 2025-01-10 16:58 Hi 'TSQLquery' is based on TBufDataset, i.e.: it inherits the ability to act like a 'TClientDataset'. I think 'CreateDataset' stems from TBufdataset, but what you want to use is actually a SQL database, with 'TSQLquery', thus it wants you to fill in the 'TSQLquery.Sql.Text' with a "CREATE TABLE IF NOT EXIST Sometablename ..." statement and the call ExecSql; HTH Regards Benny