Now, from where this tip can comes ? I tried the string below (google) without success:
site:sqlite.com +"SELECT COUNT(*) AS"
site:documentation.xojo.com +"SELECT COUNT(*) AS"
site:developer.xojo.com +“SELECT COUNT(*) AS”
Now, the query above may not be the correct way to get an answer.
PS: I searched on the internet until I found the syntax above (searching the information in the sqlite_master TABLE).
My fault (more or less): the page I read to get the syntax I used I stopped to read it once I saw what I feel is the answer. The real answer was some paragraphs to the bottom.
sqlite> create table foo ( bar , baz ) ;
sqlite> create table baz (for , bar ) ;
sqlite> create table bar (foo, baz ) ;
sqlite> select count (*) from sqlite_master where type = 'table' ;
3
This code is just wrong for getting the COUNT back
[code]
MyTABLE_RS = db.SQLSelect(“SELECT COUNT (*) FROM sqlite_master WHERE type=‘table’”)
MyTABLE_Count = MyTABLE_RS.RecordCount
[code]
RecordCount gives the NUMBER OF ROWS retrieved and in the case there is 1 row
It doesnt check the value of the data retrieved (which from the example above is 1 ROW with 1 column that contains the value 3)
[code]
MyTABLE_RS = db.SQLSelect(“SELECT COUNT (*) FROM sqlite_master WHERE type=‘table’”)
MyTABLE_Count = MyTABLE_RS.idxField(1).Integervalue
[code]
gets the VALUE from the one column in the one row returned