Android Question creating a new .db file

Laurie

Member
Licensed User
Longtime User
the database examples (persons.db) seem to be being created by copying an existing file???
How do I create a new db file?
 
something likr this:

Code: Copy
Sub create_new_db
db.Initialize(dbdir,"auth.db",True)

db.ExecNonQuery("CREATE TABLE servers (id INTEGER PRIMARY KEY, servername TEXT UNIQUE, domain TEXT, username TEXT, passwd TEXT, anon INTEGER)")

End Sub

the True in the db.Initialize statement tells the method to create the file if it doesn't exist. from there you create the tables and define the fields inside the table(s) using SQL statements.

--- Jem
 
Upvote 0
If you prefer an Addon for firefox then you can give this a try.
 
Upvote 0
Thank you both for your prompt responses. Klaus, you're absolutely right, all I needed is in your example SQLiteLight1
 
Upvote 0
Back
Top