Bentley Map C# Addin to establish Oracle Spatial and SQLServer connection on startup (without exposing the password)

About this C# Addin

This application (AutoDBConn) was developed to work as an add-on application on top of Bentley Map Enterprise, Bentley Map Standalone and/or Bentley Map for MicroStation V8i SS3 or higher.

 

The aim of this tool is to store the Database password (using cryptography) allowing you to automatically connect to an Oracle Spatial or SQL Server database, by using the MS_GEOINITCMD parameter, without exposing the password.

 

Note: This tool is supplied as is. These applications do not come with support. Bentley Systems Inc. and the author of these programs assume no liability for damages direct, indirect, or consequential, which may result from the use of this programs. Use this application at your own risk.

 

Installation

AutoDBConn.dll should be copied into the folder:

<ProgramFiles>\...Map/MapEnterprise\mdlapps\

<ProgramFiles>\...Map\Map\mdapps\

 

How to Create the Configuration File

To configure your connection, open any Bentley Map session and run the following KEY-IN to launch the configuration form:

 

Key-In: MDL LOAD AUTODBCONN; AUTODBCONN LOAD FORM

 

Use the buttons: New, Delete, Open or Save to manage the configuration settings file.

 

The configuration file is created using the XML format and can store the configuration for both Oracle Spatial or SQL Server, however, only one connection is allowed using the Map Interoperability.

   

How to Configure your GSA project to automatically open the connection

 

Open your XML project using Bentley Geospatial Administrator (or change your MS_GEOINITCMD variable).

 

Go to Macros section and add the following lines.

 

MS_GEOINITCMD = Mdl Load AutoDBConn

MS_GEOINITCMD > AutoDBConn AutoConnect [Named | Session] “ConfigurationName”

Usage: AUTODBCONN AUTOCONNECT [Options] <Configuration Name>

 

Options:

Named: to open named connections;

Session: to open Session connections;

 

Examples:

 AUTODBCONN AUTOCONNECT NAMED MyNamedConnection;

 AUTODBCONN AUTOCONNECT SESSION MySessionConnection;

  

Note: This application uses the standard GDI Map Interoperability Key-ins to connect to the database;

Have not tested on Oracle using Windows Authentication;

This version doesn’t contain resources to test database connectivity, please make sure to type the password correctly, or use copy and paste operations to ensure the password is right.

The configuration name and the path to the XML file are stored inside the HKEY_CURRENT_USER Registry Root folder.

Using the Open Configuration File operation will load the configuration into the form and also creates new registry entries.

AutoDBConn_BentleyMap.zip
Anonymous
Parents Comment Children
No Data