Create database from application

I would like to create a database with tables if database does not exist (on application open event)
I red in the forum that you can import a database and also export it if needed.
I dragged the database into the application’s ‘Files’ folder named as ‘dbname’.
How can I create (export) the database ?

First off, what database are you using or do you want to use?

The embedded database is Sqlite.

it’s a sqlite database

Check if the database file exists. If not create it, and the tables and fields you need. Have a look at the Database class docs:

That does not help. I have already a database with tables linked in the application, all I want to know is, how can I export the database in a special folder if it does not exist.

Communication is clearly failing here. What do you mean by “export”? Copy the database file? Or export to a .csv or suchlike?

Then, “I would like to create a database…” is not a good way to start the thread. Not sure what you are wanting to do here, you should clarify your request.

You definitely cannot export something, which doesn’t exist.

You obviously haven’t dealt with any Nigerians lately! :wink: