Hi again fellows SQLiters and thank you Mr. Hipp for this great C code!
I was under the impression that sqlite3_open_v2 allows you to know for sure if the database is or isn't opened successfully when using the SQLITE_OPEN_READWRITE flag. But when the first argument to sqlite3_open_v2 is NULL, the function returns SQLITE_OK, counter to my logic. Of course, subsequent error messages appear from trying to execute SQL statements on a non-existent database, but the point is the error comes too late and not at the appropriate time i.e. the opening of database. So, I conclude it's the programmer's job to test, prior to executing sqlite3_open_v2, if there's a database to open at all (for example testing the value of argc from 'int main(int argc, char **argv)' where argv would be the database path). Is the returning of SQLITE_OK from sqlite3_open_v2(NULL, _, SQLITE_OPEN_READWRITE, _) an intended feature? If so, then I think this info could be useful to have it mentioned in the sqlite3_open Documentation under SQLITE_OPEN_READWRITE: http://www.sqlite.org/c3ref/open.html I think it should go like this: "In either case the database must already exist, otherwise an error is returned _, except when first parameter is NULL_." I'm not a programmer, so just bare with me please.. Marian Cascaval _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users