Re: [sqlite] sqlite3_open on non-DB file

2008-10-17 Thread Thomas Briggs
I think there are some self-identifying bits at the start of a valid SQLite file... you could open the file directly and check for those. Or, if you're going to retrieve a list of table names from sqlite_master when first opening the database, you could trap the SQLITE_NOTADB when executing

[sqlite] sqlite3_open on non-DB file

2008-10-17 Thread Antoine Caron
Hi guys, 1st I'd like to say I'm pretty new to SQLite, about 1 week. I'm trying to handle correctly the DB opening and here's some question on this. #1 I'm validating the db.sqlite file exist. if it doesn't, it creates it, right ? so right after being created, is the sqlite_master table