The following table describes the key connection string parameters for connecting to Dynamics 365 via the ODBC driver.
| Parameter | Description |
|---|---|
Authentication |
Specifies the authentication method used to connect to Dynamics 365. Available values:
|
Client Id |
Specifies the Dynamics 365 client ID, required for OAuth 2.0 authentication. |
Client Secret |
Specifies the Dynamics 365 client secret, required for OAuth 2.0 authentication. |
Password |
Specifies the Dynamics 365 password, required for password-based authentication. |
Refresh Token |
Specifies the OAuth 2.0 refresh token, required for OAuth 2.0 authentication. |
Server |
Specifies the Dynamics 365 server URL. |
User ID |
Specifies the Dynamics 365 username, required for password-based authentication. |
| Parameter | Description |
|---|---|
Proxy Password |
Specifies the password required for proxy authentication. |
Proxy Port |
Specifies the port number for the proxy server. |
Proxy Server |
Specifies the hostname or IP address of the proxy server. |
Proxy User |
Specifies the username required for proxy authentication. |
| Parameter | Description |
|---|---|
AllowNullStringsInMetadata |
Allows metadata retrieval even when some parameters contain NULL values, ensuring compatibility with third-party tools that pass NULL. The default value is True. |
Cache Metadata |
Configures metadata caching. Available values:
|
Connection Timeout |
Sets the timeout (in seconds) for establishing a connection. The default value is 60. |
EmptyStringsAsNullInMetadata |
Converts empty strings to NULL when retrieving data. The default value is True. |
ODBC Behavior |
Specifies the ODBC specification version the driver must conform to, based on the expectations of a third-party tool. Typically, the driver’s behavior is controlled by setting the SQL_ATTR_ODBC_VERSION attribute via the SQLSetEnvAttr function. However, some third-party tools expect the driver to behave according to ODBC 2.x standards, but either fail to set this attribute or pass an incorrect value.In such cases, you can explicitly define the required behavior in the connection string using the ODBC Behavior parameter. Available values:
|
Query Timeout |
Sets the timeout (in seconds) for query execution. The default value is 60. |
RegionalDateTimeSettings |
Enables local regional settings for converting dates and times to strings. The default value is False. |
RegionalNumberSettings |
Enables local regional settings for converting numbers to strings. The default value is False. |
ReturnForeignKeys |
Specifies whether to include foreign keys in metadata queries, which may impact performance. The default value is False. |
String Types |
Specifies the type of string data returned. Available values:
|
UTC Dates |
Specifies whether datetime values should be returned as UTC or converted to local time. The default value is False. |
The following sample Dynamics 365 ODBC connection string uses password-based authentication.
DRIVER={Devart ODBC Driver for Dynamics 365};Server=https://dynamicsaccount.crm.dynamics.com;User ID=your_dynamics_username;Password=your_dynamics_password