Using a Connection String
For some applications, you might need to use a connection string to connect to your data source. For detailed information about how to use a connection string in an ODBC application, refer to the documentation for the application that you are using.
The connection strings in the following sections are examples showing the minimum set of connection attributes that you must specify to successfully connect to the data source. Depending on the configuration of the data source and the type of connection you are working with, you might need to specify additional connection attributes. For detailed information about all the attributes that you can use in the connection string, see Connector Configuration Options.
Note:
If the server does not support HTTPS connections or SSL verification, then you must disable those features by setting additional properties in your connection string. For more information, see Configuring SSL Verification.
DSN Connection String Example
The following is an example of a connection string for a connection that uses a DSN:
DSN=[DataSourceName]
[DataSourceName] is the DSN that you are using for the connection.
You can set additional configuration options by appending key-value pairs to the connection string. Configuration options that are passed in using a connection string take precedence over configuration options that are set in the DSN.
DSN-less Connection String Example
Some applications provide support for connecting to a data source using a connector without a DSN. To connect to a data source without using a DSN, use a connection string instead. You can connect to the data source using either SQLBrowseConnect or SQLDriverConnect.
The placeholders in the examples are defined as follows, in alphabetical order:
- [YourInstanceURL] is the URL of the OSvC instance that you are connecting to.
- [YourPassword] is the password corresponding to your OSvC user name.
- [YourUserName] is the user name that you use to access OSvC.
Connecting to OSvC Using Basic Authentication
The following is the format of a DSN-less connection string for connecting to OSvC using basic authentication:
Driver=Simba ODBC Driver for OSvC;Host=[YourInstanceURL];Auth_Type=Basic;UID=[YourUserName];PWD=[YourPassword];
For example:
Driver=Simba ODBC Driver for OSvC;Host=osvc.example.com;Auth_Type=Basic;UID=skroob;PWD=123456;
- Creating a Data Source Name
- Configuring the Driver
- Connector Configuration Options