Creating a Data Source Name
Typically, after installing the Simba MongoDB ODBC Driver, you need to create a Data Source Name (DSN).
Alternatively, for information about DSN-less connections, see Using a Connection String.
For detailed information about the options on this page, see General Driver Configuration Options
To create a Data Source Name:
- Open the ODBC Administrator:
- If you are using Windows 7 or earlier, click Start > All Programs > Simba MongoDB ODBC Driver 2.2 > ODBC Administrator.
- Or, if you are using Windows 8 or later, on the Start screen, type ODBC administrator, and then click the ODBC Administrator search result.
In the ODBC Data Source Administrator, click the Drivers tab, and then scroll down as needed to confirm that the Simba MongoDB ODBC Driver appears in the alphabetical list of ODBC drivers that are installed on your system.
Make sure to select the ODBC Data Source Administrator that has the same bitness as the client application that you are using to connect to MongoDB.
- To create a DSN that only the user currently logged into Windows can use, click the User DSN tab.
- Or, to create a DSN that all users who log into Windows can use, click the System DSN tab.
In the Create New Data Source dialog box, select Simba MongoDB ODBC Driver and then click Finish. The Simba MongoDB ODBC Driver DSN Setup dialog box opens.
In the Data Source Name field, type a name for your DSN.
Optionally, in the Description field, type relevant details about the DSN.
It is recommended that you create a System DSN instead of a User DSN. Some applications load the data using a different user account, and might not be able to detect User DSNs that are created under another user account.
- In the Server field, type the name or IP address of the host where your MongoDB instance is running.
- In the Port field, type the number of the TCP port that the server uses to listen for client connections.
The default port used by MongoDB is 27017.
- In the Database field, type the name of the database that you want to access.
- If you are connecting to a replica set in your MongoDB implementation, select the Connect to Replica Set check box and then do the following:
- In the Replica Set Name field, type the name of the replica set (this is a required field).
- In the Secondary Servers field, type a comma-separated list of the servers in the replica set. You can indicate the TCP port that each server is using to listen for client connections by appending a colon (
:) and the port number to the server name or IP address.
- In the Read Preference drop-down list, select the appropriate option to specify how the driver routes read operations to the members of a replica set.
- If the database that you are connecting to requires authentication, then use the options in the Authentication area to configure authentication as needed. For more information, see Configuring Authentication.
- To configure advanced driver options including write-back options, click Advanced Options. For more information, see Configuring Advanced Options.
- To configure client-server verification over SSL, click SSL Options. For more information, see Configuring SSL Verification.
- To launch the Schema Editor application and create or customize the schema definition that the driver uses when connecting to the database, click Schema Editor.
For information about how to use the Schema Editor, see the Schema Editor User Guide located in the installation directory of the driver.
- On Windows 7 or earlier, the guide is available from the Simba MongoDB ODBC Driver program group in the Start menu.
- On Windows 8 or later, you can search for the guide on the Start screen.
- To configure logging behavior for the driver, click Logging Options. For more information, see Configuring Logging Options.
- To test the connection, click Test. Review the results as needed, and then click OK.
If the connection fails, then confirm that the settings in the Simba MongoDB ODBC Driver DSN Setup dialog box are correct. Contact your MongoDB server administrator as needed.
- To save your settings and close the Simba MongoDB ODBC Driver DSN Setup dialog box, click OK.
- To close the ODBC Data Source Administrator, click OK.