• Welcome to SQLitening Support Forum.


Welcome to the SQLitening support forums!

Main Menu

Database Open questions

Started by Skip, August 18, 2013, 12:35:28 PM

Previous topic - Next topic


Is there a way to detect a currently opened database?

Thanks in advance -


Rolf Brandt

From the Help file:

slIsOpen () Long
Returns %TRUE if there is a database open.


slGetDatabaseAndFileNames  () String
Returns a list of database and file names that are currently opened and attached.  The name entries are returned as a delimited text string which is $NUL separated.  Each entry contains two elements, a database name and a file name. The two elements are separated by the vertical bar (|) character. The first entry is always the Main database from the slOpen command.  The second entry will be the Temp database, but only if there are temporary tables currently created.  The rest of the entries, if any, will be the attached databases.  There are no file names assigned to temporary tables nor temporary databases. Will return an empty string if there is no open database.

These functions of course will detect only if they are opened by your program, not by another program.

I like to cook with wine - sometimes I even add it to the food.


Rolf -

Thanks much for the reply!

I especially liked the additional info you responded with.  Since slIsOpen() doesn't allow one to
ask which database is open, I'll probably want to also explore your 2nd method.