Public Sub whoami()

   Dim oSc As IBBSessionContext

   Set oSc = REApplication.SessionContext

   'the RegRoot property will give the REINI_# which will allow

   'the user to determine which database is open. Generally REINI_50

   'is Sample and REINI_1 or REINI_2 is production

   Debug.Print oSc.RegRoot

   

End Sub



Once you have the REINI_Value:



    • Open the registry.

    • Browse to the path returned from SessionContext.RegRoot (Software\Blackbaud\REIni_1).

    • Select the General key (HKEY_LOCAL_MACHINE\SOFTWARE\Blackbaud\REINI_1\General).

    • Look for the DSN String Value (HKEY_LOCAL_MACHINE\SOFTWARE\Blackbaud\REINI_1\General\DSN).

    • Take note of the data value (RE7_1).

    • Browse to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI.

    • Highlight the corresponding entry (RE7_1).

    • Take note of the Server and Database String Values.

    Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.