Where to store database ID

Pascal Lehner tate83 at gmail.com
Thu Jul 25 10:56:39 EDT 2013


Hi all,

I am working on a project with a SQLite DB and I'm wondering if there is an
improvement to the following:

On preOpenStack I connect to the database and store the connection ID in a
custom property on the main stack.

In whatever command I  write or execute where I use any sql command to read
or write data, I always have to get the connection ID from the custom
property and put it in a local variable as the first thing of this command.
This means I repeat that "put custom variable in local variable" quite
often..

Is this the right way or would you probably store it once in a global or
so? Also, when does this connection ID expire and I need a new one? How can
I recognise that before the DB returns an error?

Cheers from foggy Edinbra..

Pascal



More information about the use-livecode mailing list