Android Question Application keep using old database

EvilCarrot

New Member
Licensed User
Longtime User
Hello,
I've updated the database my application is using, including editing one columng name- let's say I've changed it from "Users" to "Clients".
However, when I'm debugging the app using B4A Bridge it keep acts like it was using the old DB. When I want to select all the rows where "Clients='xxx'' it returns 0 of them, but when I change it back for the old name ("Users='xxx'") it works just fine. I've tried rebooting the phone, changing DB name and deleting the old database from the files folder and the files tab. Does anybody know how I can deal with this problem?
 

EvilCarrot

New Member
Licensed User
Longtime User
Ok, sorry :)
I initialize it in "Sub Activity_Create(FirstTime As Boolean)" using this code:
B4X:
File.Copy(File.DirAssets,"db.sqlite",File.DirInternal,"db.sqlite")
SQL.Initialize(File.DirInternal, "db.sqlite", False)

As you can see in the code, it is stored inside the app
I've updated it by just changing the file in "Files" folder, however I plan it to update it remotly from the server after the app will be published
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Try to add the database file to the files tab of the IDE by clicking the 'Add File' instead of simply putting the database file in the files folder.
 
Upvote 0

EvilCarrot

New Member
Licensed User
Longtime User
Done that too, sorry, forgot to mention it.
I've also try adding new db under new name both in the folder and files tab with deleting the old database from both files tab and files folder.
 
Upvote 0

EvilCarrot

New Member
Licensed User
Longtime User
Looks like I made a mistake when working in SQLite Studio and I was looking for the couse in B4A. Sorry for wasting your time for such a stupid thing and thank you for pointing out my embarrassing mistake!
 
Upvote 0
Top