I've just started learning about SQLite. I've written PureBasic code that successfully reads an SQLite file from disk and displays the records in a ListIconGadget with the record ID in the first column followed by other fields in additional columns. That part works well but I'm needing help with the next stage of reading and displaying record fields.
My ultimate intention is that I click on a row in the ListIconGadget and then click a button that will open a window and display the field entries for that record.
My record reading code so far is:
Code: Select all
rowNumber = GetGadgetState(ligFrmMain) ;Determine the row number in the ListIconGadget
readRecordIDStr = GetGadgetItemText(ligFrmMain, rowNumber, 0) ;Read the Record ID which is stored on the first column
OpenDatabase(sqliteNo, "myData.db", "", "") ;Open the database file
SetDatabaseString(sqliteNo, 0, readRecordIDStr) ;Set the record ID for data binding in the query
query.s = "SELECT * FROM myTable where id = ?" ;Make the query string
DatabaseQuery(sqliteNo, query)
Debug GetDatabaseString(sqliteNo, 2)
CloseDatabase(sqliteNo)
Thanks in advance