Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sqlite.ToQmGrid ...Adding multiple tables to same grid
#2
not tested

Member function Sqlite.ToQmGrid2
Code:
Copy      Help
function hgrid $sql [flags] ;;flags: 1 except first column, 2 append

;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

if(flags&2) x.nr=x.g.RowsCountGet
else x.g.RowsDeleteAll(x.firstcol)


ExecF(sql &Sqlite_QgCallback &x)
err
,if(x.es.len) end x.es
,end _error


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)