OK,
With the following code :
-------------------------------------------------
sqlite3 *db = NULL;
if( sqlite3_open( "D:\Test3.db", &db) != SQLITE_OK )
{
// Exit if error while opening.
wxMessageBox( wxString( "Error while opening :\n") <<
sqlite3_errmsg(db) );
sqlite3_close(db);
return;
}
if( sqlite3_close( db ) != SQLITE_OK );
{
// Exit if error on closing.
wxMessageBox( wxString("Error while closing : \n") <<
sqlite3_errmsg( db ) );
return;
}
__________________________
A Message windo prompts : " Error while closing : library routine
called out of sequence "
I have to say that the statement sqlite3_open works fine because I
have no error on opening and I can successfully write/retrieve data in
the Test3.db database file.
I really don't understand....
On Feb 23, 6:02 pm, Simon Davies <[email protected]>
wrote:
> On 23 February 2010 16:46, newlog <[email protected]> wrote:
>
> > Hi Simon,
>
> > Thanx for your answer,
>
> > IN case of error when trying to open the file, we close db pointer and
> > exit the sub-routine ( return keyword follows closing ).
>
> > So 'sqlite3_close' can't be called twice.
>
> My point was that if the database open has failed, then close will
> provoke MISUSE
>
>
>
> > Sincerely,
>
> > John
>
> Regards,
> Simon
> _______________________________________________
> sqlite-users mailing list
> [email protected]http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users