Android Question SQLite

Pilar-JLSineriz

Active Member
Licensed User
Longtime User
Hello... I have a SQlite database, and I view the tables content from different activities.. Now, I have an error "android.database.sqlite.SQLite exception; no such table!

I can´t understand, because the table is in the database, I suppose that the application is using a BD that it is not the last version. how I can test which BD is using my application?

Best regards and thanks
 

inakigarm

Well-Known Member
Licensed User
Longtime User
Maybe a coding query error ?? Take the SQL Query you're coding in B4A and test it with an external SQLite Browser program with your DB
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Without knowing what exactly you have done it's almost impossible to give a concrete advice.
How and where do you declare the SQLite object ?
Where do you save the database ?
Are you sure that the database is in the folder where you declare it to be ?
etc...
 
Upvote 0

Pilar-JLSineriz

Active Member
Licensed User
Longtime User
Without knowing what exactly you have done it's almost impossible to give a concrete advice.
How and where do you declare the SQLite object ?
Where do you save the database ?
Are you sure that the database is in the folder where you declare it to be ?
etc...
Dear Klaus,
I declare the SQlite object following the instructions User's guide (4.1 SQlite Database basics).
 
Upvote 0

Pilar-JLSineriz

Active Member
Licensed User
Longtime User
Hello, again, Klaus, now I have other problem, in a first time, the BD name was "pasivosmineros.sqlite". Now, I rename to "PasivosMineros.sqlite". If I execute the application in debbug mode, I don´t have problem, but I execute in release mode, I have an error "java.io.filenotfoundexception:"pasivosmineros.sqlite", how I can solve it? Thanks again

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
File.Delete(File.DirInternal, "PasivosMineros.sqlite") ' only for testing, removes the database

If File.Exists(File.DirInternal, "PasivosMineros.sqlite") = False Then

File.Copy(File.DirAssets, "PasivosMineros.sqlite", File.DirInternal, "PasivosMineros.sqlite")

s.Initialize(File.DirInternal, "PasivosMineros.sqlite", True)
File.Copy(File.DirAssets, "PasivosMineros.sqlite", File.DirInternal, "PasivosMineros.sqlite")
Else
s.Initialize(File.DirInternal, "PasivosMineros.sqlite", True)
End If

End If

Activity.LoadLayout("screen1_pasivominero")
Activity.title="Inventario de Pasivos Mineros"

End Sub
 
Upvote 0

Pilar-JLSineriz

Active Member
Licensed User
Longtime User
Hi Klaus, I solved the problem in build configurations using different name for the package.. I don´t know if it is the best solution but it works
 
Upvote 0
Top