- Lynne Harding
- Posts : 335
Join date : 2018-12-20
How can I display the current database name through code?
Thu 23 Jan 2020 - 8:40
I am trying to display the database I am connected to in a multi database environment. I have used the following code: FWBS.OMS.UI.Windows.MessageBox.Show(CurrentSession.CurrentDatabase.DatabaseName.ToUpper()); For an example I have just created a button which displays the database name in a message box and the code is on the event 'Click'. This is prompted with the error: “The software application component is not authorised to access critical data “Database Settings” due to its protection level.” Is there any way to define the protection level or to just display the database name which I am connected to? This behaviour mirrors the Matter Centre 'about' screen but just trying to expose the database name function.
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Response from Graham Shaw 24-11-2009
Thu 23 Jan 2020 - 8:41
We do this by creating a dlatlist that returns db_name()G
Permissions in this forum:
You cannot reply to topics in this forum