Yes, confusing - but interesting!
I believe (someone correct me if I'm wrong!) that this is an effect of the type-less nature of SQLite.
In your example, you are in fact storing all the values as strings in both columns. Regardless of the column definition, SQLite will store any data type in any column. But there a notable exception - "INTEGER PRIMARY KEY".
If you add "PRIMARY KEY" to your first column, then your example works correctly - returning True or False alternately. Why this effects the boolean column I do not know
, but the values are then stored as 0 or 1.
In your original code, you can test that the values are strings by adding a new button with this sub:
Sub Button3_Click
Con.Open("Data Source = " & AppPath & "\TestBool.db3")
xCommand="SELECT * FROM test_1 WHERE m_bool = 'true'"
Cmd.CommandText = xCommand
Cmd.ExecuteTable("tbl",0)
Con.Close
End Sub
The rows with the string values "true" are returned, but shown as "False", presumably because B4ppc or the SQLite wrapper it trying to interpret the string as an actual boolean - which it is not.
Your insert statement should be something like (no single apostrophes):
xCommand="INSERT INTO test_1 VALUES (" & k & "," & BoolNum(xVal) & ")"
This will ensure the values are stored as numeric and will return them correctly in the table.
Only my thoughts - Geoff.