On 20 Jul 2012, at 11:51am, Arbol One <arbol...@gmail.com> wrote: > Is there a way to find out if a certain database AND table already exist? > > In my C++ program I would like to query SQLite3 to find out if a database > already exists and also if a particular table exists in that database. Is > there a way to do this?
To find out if a database exists, use sqlite3_open_v2() and use the flag SQLITE_OPEN_READONLY as documented on <http://www.sqlite.org/c3ref/open.html> If the database doesn't exist, you'll get an error. If the database does exist, it'll be opened and you can continue with PRAGMA table_info(myTable) as documented here <http://www.sqlite.org/pragma.html#pragma_table_info> Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users