TaifunSQLite1 - ERROR: no such table

Hello.
I have an app with TaifunSQLite1 where I use dbBooks.db and there is a panel tblBooks.
The dbKnihy.db database is located at:
/storage/emulated/0/Android/data/appinventor.ai_ondrejruz.Knihy/files/dbKnihy.db

It worked OK for me on a mobile with Android 8.
On a mobile phone with Android 13, it crashes with the error:

ERROR: no such table: tblKnihy(code 1 SQLITE_ERROR(1)):,
while compiling: SELECT MAX (id) FROM tblKnihy;

Where am I doing wrong?
Thanks.
Ondrej

How do you send the db file to this ASD location? Are you sure the Import function is working fine? what about use full path as fileName?

Hello Ondrej

Where exactly is 'dbKnihy.db' stored? What is the full path?

(Not sure why 'SQLDotaz' is made up with a text join, it could simply be one text.)

Usually you upload the initial database to the assets and import it from there... see the example project

EDIT: You can use the ErrorOccurred event of the extension to find out, if there was an error while importing the database

Taifun

Does this mean the database is found, but it actually does not contain the Table? This is new to your Android 13 phone, did you have to create the Table as a one-off on your Android 8 phone?

There always is an empty database... like TinyDB... most probably the import failed...

Taifun

Unfortunately, it doesn't work.
And isn't it because I'm testing it through AI Companion?
And I previously copied the database to the address book via the file manager?
Ondrej

I am solving this problem:

  • I have created a SQLite database dbKnihy.db
  • I don't want to put this database on the web
  • I want to have it on several mobile phones
  • I am updating one mobile database
  • how do I get the database to another mobile without having to create a new .apk and put the database in assets
    Ondrej

You could share the dB by email, if not too large in file size, then the other users could set the dB in their apps.

Is that "another mobile" yours, a friends or do you intend to distribute the App more widely?

Let's take a look together into the documentation

Import database.
Note : Starting with SDK30 Android restricts accessing the file system. Therefore starting from Version 2 of the extension you can import the database only from the assets or from ASD - application specific directory. As fileName just use the filename without slashes.

Which means, just oopy the database file to ASD and import it from there without using slashes like this dbKnihy.db

Edit: which version of the extension are you using?

You might think about uploading it to your Google Drive and download it from there to ASD...

What exactly does not work? What about providing a screenshot of your relevant blocks? If you do not get an error while uploading then the upload was successful

What is the address book? Can you show us a screenshot of the file location?

You do not want your users to do this manually each time they have to import a new version...

Taifun

Are you sure, that table exists in your imported database? To list all available tables, use this statement


Taifun

It's more mobiles.

You could always consider this: