Code causing me a problem.
I am just experimenting with a very simple questions and answers app., more to test B4A than anything else. I have created an sqlite database and added to my files tab. When I click a button which just sets the 'search' variable and executes the above code I get an error.
no such table: qa:, while compiling: SELECT ... etc.
The table is called qa and is inside a database named fedqa.db.
Elsewhere I declare (variables set accordingly)
If FirstTime Then
SQL1.Initialize(dbfiledir, dbfilename, True)
End If
Clearly it cannot see the table named qa, but how do I know even if my program can see the database?
Sub SQLTableRead
Dim i As Int
Dim Cursor1 As Cursor
Dim txt, wtxt As String
txt="SELECT * FROM qa WHERE category like '%"&search&"%'"
Cursor1=SQL1.ExecQuery(txt)
lstQuestions.Initialize("lstQuestions")
Activity.AddView(lstQuestions, 0, 0, 100%x, 75%y)
For i=0 To Cursor1.RowCount-1
Cursor1.Position=i
lstQuestions.AddSingleLine(Cursor1.GetString("Question"))
Next
End Sub
I am just experimenting with a very simple questions and answers app., more to test B4A than anything else. I have created an sqlite database and added to my files tab. When I click a button which just sets the 'search' variable and executes the above code I get an error.
no such table: qa:, while compiling: SELECT ... etc.
The table is called qa and is inside a database named fedqa.db.
Elsewhere I declare (variables set accordingly)
If FirstTime Then
SQL1.Initialize(dbfiledir, dbfilename, True)
End If
Clearly it cannot see the table named qa, but how do I know even if my program can see the database?
Last edited: