Aravinda babu wrote:
Hi all,

Does sqlite have any mechanism to determine if sqlite3_open has
created a new database or opened an existing database?


sqlite3_open returns SQLITE_OK for both creation and open

How can i check whether it created or opened an existing database ?

Thanks in advance,
Aravind.
Hello!

If you're using sqlite3_open, just check whether the database file exists before calling sqlite3_open.

Or you could use sqlite3_open_v2, where you can specify separately (using the flags parameter) whether you want a new database to be created or not.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to