On Tue, 1 Mar 2016 17:13:29 +
a a wrote:
> I want to check after a while if the connection is allready closed or
> not for the simple reason not to reopen the database but if is open
> to run a query or if it is closed to reopen the database and then run
> the query.
I don't blame you for
Another tactic: ?why not try a simple query such as "SELECT SQLITE_VERSION()"?
?If you get a decent answer you have verified your connection and can execute
your actual query.
On Tuesday, March 1, 2016 2:41 PM, Keith Medcalf
wrote:
After you close the connection and verify the return
understood, i will use that way if it is the appropiate though it worked in the
previous i mentioned
Thanks
From: sqlite-users-bounces at mailinglists.sqlite.org on behalf of Andy Ling
Sent: Tuesday, March 1, 2016 7:23 PM
To:
I don't think this will work. sqlite3_open and sqlite3_close return a status
which, if they worked, is SQLITE_OK.
A simpler solution might be to set ppDB to NULL in your code every time you
close the database.
So add something like
sqlite3_close(ppDB);
ppDB = NULL ;
Then the original test
Let me explain it better cause i got confused and i am a newbie also.
I open a connection like this
sqlite3 *ppDB;
int dbcon;
dbcon = sqlite3_open(databasename, );
/// i do my code i query the database i do some stuff and i close the database
like this
dbcon = sqlite3_close(ppDB);
I want to
On 1 Mar 2016, at 4:59pm, a a wrote:
> the sqlite3_close() <--- needs one argument if i pass sqlite3_close(NULL) it
> actually closes again a closed connection ?
No. If you pass it null it realises that the connection is closed and does
nothing.
Simon.
the sqlite3_close() <--- needs one argument if i pass sqlite3_close(NULL) it
actually closes again a closed connection ?
I cant find if the certain sqlite3 *ppDB is open or closed :/
if(ppDB){
//is open
}else{
//is closed
}
It returns always that the ppDB is open in the above function
On 1 Mar 2016, at 4:47pm, a a wrote:
> Nope the previous was errored it doesn`t actually check it if the ppDB is
> allready closed :/
> It works only if it is open and not closed otherwise if sqlite3_close(ppDB)
> was previously called it sees it as open again
sqlite3_close() ignores
Nope the previous was errored it doesn`t actually check it if the ppDB is
allready closed :/
It works only if it is open and not closed otherwise if sqlite3_close(ppDB) was
previously called
it sees it as open again :/
Any other way ?
From:
It is
if (ppDb != NULL) {
// it's open
} else {
// it's closed
}
yeap it works correct
thank you
From: sqlite-users-bounces at mailinglists.sqlite.org on behalf of Simon Slavin
Sent: Tuesday, March 1, 2016 6:33 PM
To:
On 1 Mar 2016, at 4:31pm, a a wrote:
> Thank you Simon indeed what i was looking for
Please test it first. I can't test C programs here at work and I can't find
documentation that it works.
Simon.
Thank you Simon indeed what i was looking for
From: sqlite-users-bounces at mailinglists.sqlite.org on behalf of Simon Slavin
Sent: Tuesday, March 1, 2016 6:17 PM
To: SQLite mailing list
Subject: Re: [sqlite] How to check if
On 1 Mar 2016, at 4:02pm, a a wrote:
> I am trying to find if there is a return value of true false or anything that
> can tell me that a connection to sqlite database is open or close
>
> Can you tell me which function is appropiate for this reason ?
If I understand correctly, SQLite sets
I am trying to find if there is a return value of true false or anything that
can
tell me that a connection to sqlite database is open or close
Can you tell me which function is appropiate for this reason ?
Thank you in advance
After you close the connection and verify the return code, why not set the
pointer to 0 (NULL). In that way you will know that the handle is no more
valid rather than just hoping and praying that it is?
> -Original Message-
> From: sqlite-users-bounces at mailinglists.sqlite.org
15 matches
Mail list logo