> Le 4 sept. 2017 à 16:46, Phoenix <rwm.phoe...@btinternet.com> a écrit :
> 
> Is there anyway to confirm the file I am about to open, via
> sqlite3_open, is in fact an SQLite Database?

You may have noticed that sqlite3_open doesn't fail if the file is not a 
database.

To check if the file is a valid database, read something. For example: "SELECT 
* FROM sqlite_master LIMIT 1" (I'm sure there are shorter/smarter test access, 
but this one does the job). SQLite will then fail unless the file is actually a 
database.

Gwendal Roué

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to