How to convert MDB to SQLite in Android

前端 未结 4 714
栀梦
栀梦 2020-12-10 21:49

I have one Microsoft Access .MDB file and want to use that database in an Android application.

How can I convert the .mdb database to SQLite?

4条回答
  •  感动是毒
    2020-12-10 22:33

    Steps to read Access files in android :

    1-Creat Acces Database then,Export the access database into text files, semicolon or comma delimited. 2-Open the SQLite database browser version 1.1 ( http://sourceforge.net/projects/sqlitebrowser/files/sqlitebrowser/1.1/sqlitebrowser-1.1-win.zip/download?use_mirror=garr&download= ) and chose creat new DATABASE then enter it's name ,then file menu ->import->table from csv file. Browse for your text file and choose the proper delimiter. Click create. 3-Done.

    Then you would need to make some modifications to that database and those tables to make it usable by Android to populate listviews and other widgets.

    1) The database must contain a table called "android_metadata" 2) This table must have the column "locale" 3) There should be a single record in the table with a value of "en_US" 4) The primary key for every table needs to be called "_id" (this is so Android will know where to bind the id field of your tables) Then you put the DB in your assets folder and when your app starts copy it to your apps data directory.

    Now : Using your own SQLite database in Android applications example here: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

提交回复
热议问题