Hi,
I just installed sqlite 3 in Lazarus and am experimenting with it.
Setting up databases and forms with grids and fields is no problem but I have trouble sorting an sqlite table.
I created a table Adresses in sqlite and also an index called Adres_Name which indexes table Adresses on field Name.
Unfortunately no examples are provided with sqlite and I tried several things to get my dbgrid sorted on Name but all without succes.
On the form I've created a dbgrid and a number of dbedit fields all based on dataset dsAdresses.
dsAdresses is based on tblAdresses (which points to sqlite table Adresses)
I've tried constructions like
tblAdresses.ExecSQL('SELECT * FROM Addresses ORDER BY Name');
dbgrid1.refresh;
and
tblAdresses.ExecuteDirect('SELECT * FROM Addresses ORDER BY Name');
dbgrid1.Refresh;
and
tblAdresses.IndexFieldNames('Adres_Name');
dbgrid1.Refresh;
but nothing works.
Can anyone provide me with an example to activate an index from code and how to make this index ascending or descending?
Thanks!
:?