How can I convert my Access database (.accdb) to SQLite? - sqlite

How can I convert my Access database (.accdb) to an SQLite database(.sqlite)?

May be you can use several step algoritm:
1. Export (convert) Access table or query to Excel file
2. Save Excel file as CSV file.
3. Use any SQLLite manager (for example, phpLiteAdmin) to import data from CSV file to exist SQLLite table.
Except Android and IOS, that use SQLLite, there are still webhostings, that use no more database engine, except for SQLLite.

1) If you want to convert a structure of db you shoud use any DB-modeling tools:
create new model from existing Access Database
generate sql scripte for creating SQLite database
use this script in SQL helper
2) If you want to import data from Access Database to your android app. I think you can do case #1, migrate all data from Access Database to temporary SQLite database, save it to asset folder and rewrite from asset to internal SQLite database during first app. start

Related

How to import SQLite data into DuckDB?

How to import SQLite data into DuckDB? Or is it possible to query the SQLite data files directly from DuckDB? A presentation from author of DuckDB mentioned such a feature.
yes it is possible to scan SQLite db files directly by using the sqlite extension
You first will need to install and load it
INSTALL sqlite_scanner
LOAD sqlite_scanner
CALL sqlite_attach('your_sqlite_db.db');
Then you should be able to query the sqlite tables.

Delphi FireDAC SQLite default database path in Windows 10

I'm building a small app with a local in memory database using Delphi 10.3 with FireDAC set to SQLite.
What is de default path to the database file that SQLite uses? (i.e. Database parameter is left blank)
I want to transfer the database file to another PC. I suppose it has the .db file extension, but I'm unable to locate the file.
from http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_SQLite_with_FireDAC:
"To create and open an SQLite in-memory database use the following
parameters:
DriverID=SQLite Database=:memory: Or just leave the Database parameter
empty:"
This made me think that there should be a file that eventually stores the data, but it turns out there is none. All data is lost after the database is free'd.
By definition "in memory" means no file. If you need a file for your data then add a filename (complete with path) to the Database value in TFDConnection's Params.
You can do it in the object inspector at design time or by code at run time it looks like:
FDConnection1.Params.Values['Database'] := 'C:\ProgramData\YourCompany\YourApp\YourFile.sqlite3';
Of course it is better to set the path by querying Windows for the location of "Program Data".

Flutter SQLite database table exists but not detected by SQFLite

I wanted to fill a SQLite database with some initial data required for my app so I made a flutter app and used it to fill generate that database with the SQFLite package and then took it and put it in the assets folder of the app it will be used in, but when I query the initial data table it tells me that the table doesn't exist although the file size says that there is data in there and I used an online SQLite viewer website and the table with the data were there, So what to do?!.
A quick way to dump an existing database is schema is:
print(await db.query("sqlite_master"));
Without code, hard to say whether you correctly open the database from your assets.
You should also check that the existing database has indeed the data using some 3rd party tool (sqlite3, sqlite browser).

Any way to convert Realm database file in to sqlite?

I have realm database (.realm) from an existing application, which has more than 400k records.
I dug my head in to this for more than 3-4 hours, but I couldn't find any fruitful results towards converting a .realm file in to a sqlite file.
Any data conversion so far has been done manually. People have converted from Core Data to Realm by grabbing the objects from Core Data and then saving them to a Realm.
I imagine your best bet will be similar here. Grab each object from the Realm and then convert it to the tables/rows/and columns in sqlite. Then you can take that file anywhere.
You can open the realm file in Realm Browser & there you have the option to convert the file in to CSV ( File => Export => CSV ). Then you can import that CSV file to mysql database.
If you want sqlite more specifically, You can import tables separately to your sqlite db through SQLiteBrowser . Create or open your database file and select the specific table you want , then you can import table from CSV.
I'm not at home with this, but I found this link hopefully it can help.

Sqlite database exception: file is encrypted or is not a database in blackberry?

I am working on a firm application in which I need to create a local database on my device.
I create my local database through create statement[ It works well]
Then I use that file and perform insert operation through fire-fox sqlite plugin, I need to insert aprox 2000 rows at a time so I can not use code. I just run insert manually through sqlite plugin in fir-fox.
After that I just use that file in my place of my local database.
When I run select query through my code, It show Exception:java.lang.Exception: Exception: In create or prepare statement in DBnet.rim.device.api.database.DatabaseException: SELECT distinct productline FROM T_Electrical ORDER BY productline: file is encrypted or is not a database
I got the solution of this problem, I was doing a silly mistake by creating a file manually by right click in my RES folder, that is not correct. We need to create the database completely from SQlite plugin, then it will work fine. "Create data base from SQLITE(FIle too) and perform insertion operation from SQLITE, then it will work fine"
This is very rare problem, but i think it might be helpful for someone like me....!:)
You should check to see if there is a version problem between the SQLite used by your Firefox installation and that on the BlackBerry. I think I had the same error when I tried to build a database file with SQLite version 2.
You also shouldn't need to create the database file on the device. To create large tables I use a Ubuntu machine and the sqlite3 command line. Create the file, create the tables, insert the data and build indexes. Then I just copy the file onto the device in the proper directory.
For me it was a simple thing. One password was set to that db. I just used it and prolem got solved.

Resources