Placing openend DB filename in a variable

Hi all.
How can I grasp the file name from the database file I open in a variable so I can use it as Main window title? I noticed that I am all the time forgetting which db I am working in so it would be helpful see that in the title of the main window.

Thanks!

If you have a database open, you must already have:

Var dbh As New SQLiteDatabase, dbFile As FolderItem
dbfile = new FolderItem ("/path/to/your/database.db", FolderItem.PathModes.Native)
dbh.DatabaseFile = dbFile

or something similar, so you can just reverse that.

1 Like

If this is SQLite you’re using, you can use:

Db.DatabaseFile.Name

Thanks Greg, this worked great.

Thanks for your suggestion, Tim, I was able to get and set the window title by using this code:
WinMain.Title = "StoryCraft NE - " + Db.DatabaseFile.Name