Hi!
I've created a new db with 1 table using SQLite Database Browser 2.0 b1
I've added the .db file in b4a files
this is my code:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL As SQL
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim lblCliente As Label
Dim spnrClienteId As Spinner
Dim lstSerials As ListView
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
SQL.Initialize(File.DirInternal, "elenco.db", True)
DBUtils.CopyDBFromAssets("elenco.db")
End If
Activity.LoadLayout("elenco")
'Fill the id spinner (aka combo box).
DBUtils.ExecuteSpinner(SQL, "SELECT nominativo FROM clienti", Null, 0, spnrClienteId)
spnrClienteIdItem_Click(0, spnrClienteId.GetItem(0))
'ExportToJSON
'ShowTableInWebView
End Sub
but when launching:SELECT nominativo FROM clienti it raise an error:
no such table:clienti
why???
regards,
cirollo
I've created a new db with 1 table using SQLite Database Browser 2.0 b1
I've added the .db file in b4a files
this is my code:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL As SQL
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim lblCliente As Label
Dim spnrClienteId As Spinner
Dim lstSerials As ListView
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
SQL.Initialize(File.DirInternal, "elenco.db", True)
DBUtils.CopyDBFromAssets("elenco.db")
End If
Activity.LoadLayout("elenco")
'Fill the id spinner (aka combo box).
DBUtils.ExecuteSpinner(SQL, "SELECT nominativo FROM clienti", Null, 0, spnrClienteId)
spnrClienteIdItem_Click(0, spnrClienteId.GetItem(0))
'ExportToJSON
'ShowTableInWebView
End Sub
but when launching:SELECT nominativo FROM clienti it raise an error:
no such table:clienti
why???
regards,
cirollo