Patrick X <[EMAIL PROTECTED]> wrote:
int sqlite3_open(
const char *filename, /* Database filename (UTF-8) */
sqlite3 **ppDb /* OUT: SQLite db handle */
);
int sqlite3_open16(
const void *filename, /* Database filename (UTF-16) */
sqlite3 **ppDb /* OUT: SQLite db handle */
);
the above functions have me a little confused. So sqlite3_open, does
it returns a pointer to the open database or just the success or error
code or both.
It returns an error code via return value, and also returns a database
handle by storing it in *ppDb. That's what it means for ppDb to be an
OUT parameter.
Second, if it returns a pointer to the open db is it needed to be
stored in memory to pass it to the close or other functions within
sqlite3.
The client of SQLite needs to store sqlite3* handle. The handle is
passed to most SQLite API calls to identify a particular database
connection (the client may open more than one, to the same or different
files). When the client is done with this database connection, it calls
sqlite3_close passing the handle. After that, the handle is invalid and
doesn't need to be stored any longer.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------