01-27-2012, 02:06 AM
Hi Gintaras,
This may be a tough one...
I am trying to add the data in numerous tables in the same sqlite database (all formatted the same).
I tried to use Sqlite.ToQmGrid in a loop for each table but it erases the current contents each time.
I tried to make a custom member function based on Sqlite.ToQMGrid but with the erase line taken out but the number of rows I think caused an error to be thrown
Member function Sqlite.ToQmGridWithoutGridClear
Ideally I would write a single Sqlite SELECT statement that joins all the tables but can't figure out how to do it.
Any ideas?
Thanks, Stuart
This may be a tough one...
I am trying to add the data in numerous tables in the same sqlite database (all formatted the same).
I tried to use Sqlite.ToQmGrid in a loop for each table but it erases the current contents each time.
I tried to make a custom member function based on Sqlite.ToQMGrid but with the erase line taken out but the number of rows I think caused an error to be thrown
Member function Sqlite.ToQmGridWithoutGridClear
function hgrid $sql [flags] ;;flags: 1 except first column
;Populates QM_Grid control with data from database.
;Error if something fails, eg if SQL is incorrect.
;Error if column count in query results is greater than grid column count minus flag 1.
;hgrid - QM_Grid control handle or DlgGrid variable.
;sql - SQL statement that selects data to be displayed in the grid. For example, "SELECT * FROM table1" displays whole table1.
;<open "sample_Grid_Sqlite">Example</open>
type ___SQLITEQG DlgGrid'g ncol firstcol nr ~es
___SQLITEQG x.g.Init(hgrid)
x.firstcol=flags&1
x.ncol=x.g.ColumnsCountGet-x.firstcol
;x.g.RowsDeleteAll(x.firstcol)
ExecF(sql &Sqlite_QgCallback &x)
err
,if(x.es.len) end x.es
,end _error
Ideally I would write a single Sqlite SELECT statement that joins all the tables but can't figure out how to do it.
Any ideas?
Thanks, Stuart