Simple SQLite DataBase lazarus / 16-Databases ---------------------------------------------------------------------- GGL · 2009-10-11 09:14 Hi all. I just started using lazarus and i need your help. I make  a simple application with DBGrid Datasource and Sqlite3Datase. I use this code: Code: [Select]datasrc.Enabled:=false; dataset.FileName:='C:\test\test.db3'; dataset.PrimaryKey:='id'; dataset.Active:=true; dataset.ExecSQL('select distinct surname from pers'); dataset.First; while not dataset.EOF do begin      writeln(dataset.FieldByName('surname').AsString);      dataset.next; end; datasrc.Enabled:=true; dataset.sql := 'select * from pers where id = 2'; dataset.ExecSQL;  But it don't work fine. In DBGrid shows all recods of DataBase, but i need only 1 with id = 2. Help me plz. ---------------------------------------------------------------------- LacaK · 2009-10-12 05:35 Quote from: GGL on October 11, 2009, 11:14:08 amCode: [Select]dataset.sql := 'select * from pers where id = 2'; dataset.ExecSQL;  I am not sure (I do not use this data access component), but try: dataset.close; dataset.sql := 'select * from pers where id = 2'; dataset.open;