Quite ready to publish a new thinBasic version with a "basic" SQLite module inside
Example:
uses "Console"
uses "SQLIte"
'---Quick and dirty
sqlite_Open app_sourcepath & "SQLIte_Test.SQLITE", "C"
sqlite_Exe "Drop Table If Exists T1"
sqlite_Exe "Create Table If Not Exists T1 (F1, F2, F3, F4)"
sqlite_Close
dim lStart as Double
dim lEnd as Double
dim NumRecs as Long
'---Save starting time
lStart = Timer
'---Open sample database
sqlite_Open app_sourcepath & "chinook.sqlite"
'---Count records
sqlite_Select "Select count(1) as nRec from Customers"
sqlite_GetRow
printl "Number of records expected:", SQLite_FieldValue("nRec")
printl
'---Select record set
sqlite_Select "Select * from Customers order by CustomerId"
'---Process records
NumRecs = 0
Do While sqlite_GetRow
Incr NumRecs
'---Print something
printl strformat$("Rec: {1}, {2}, {3}, {4}", NumRecs, SQLite_FieldValue("FirstName"), SQLite_FieldValue("LastName"), SQLite_FieldValue("Company"))'SQLite_FieldValue(1), SQLite_FieldValue(2), SQLite_FieldValue("Address")
Loop
sqlite_Close
'---Save the time it took to run this test so we can display it later.
lEnd = Timer - lStart
'---Display results
printl "Test 1: Retrieve " & NumRecs & " rows." & " Time: " & Format$(lEnd, "##.0000") & " seconds."
WaitKey
Bookmarks