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 Examples

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:

  • [YourAccessToken] is your access token for authenticating to Salesforce Marketing Cloud.
  • [YourAuthType] is the authentication mechanism.
  • [YourClientID] is the client ID associated with your Salesforce Marketing Cloud app.
  • [YourClientSecret] is client secret associated with your Salesforce Marketing Cloud app.
  • [YourInstanceUrl] is the URL of the Salesforce Marketing Cloud instance that you are connecting to.
  • [YourPath] is the full path of the .pem file containing trusted CA certificates for verifying the server during SSL authentication.
  • [YourRedirectUri] is base redirect URI for OAuth 2.0 authentication.

Connecting to Salesforce Marketing Cloud Using an Access Token

You can connect to the data source using an access token through either SQLBrowseConnect or SQLDriverConnect. The following is the format of a DSN-less connection string for connecting to Salesforce Marketing Cloud using an access token:

Driver=Simba SalesforceMarketingCloud Driver;Host=[YourInstanceUrl];Auth_Type=[YourAuthType];Auth_AccessToken=[YourAccessToken];

For example, if you are using legacy packages:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;
Auth_Type=OAuth_2.0;Auth_AccessToken=1jt9Pcyq8pr3lvu143pfl4r86;

As another example, if you are using enhanced packages with server-to-server integration:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;
Auth_Type=Enhanced sts OAuth 2.0;Auth_AccessToken=1jt9Pcyq8pr3lvu143pfl4r86;

As another example, if you are using enhanced packages with a web or public app integration:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;
Auth_Type=Enhanced OAuth 2.0;Auth_AccessToken=1jt9Pcyq8pr3lvu143pfl4r86;

Connecting to Salesforce Marketing Cloud With Your Salesforce Marketing Cloud Credentials

You can connect to the data source using your Salesforce Marketing Cloud application information through SQLBrowseConnect only. The connector initiates an OAuth 2.0 authentication flow based on your credentials, and then uses the retrieved access token to authenticate the connection. The following is the format of a DSN-less connection string for connecting to Salesforce Marketing Cloud using your Salesforce Marketing Cloud application information:

Driver=Simba SalesforceMarketingCloud Driver;Host=[YourInstanceUrl];Auth_Type=[YourAuth_Type];Auth_Client_ID=[YourClientID];Auth_Client_Secret=[YourClientSecret];

For example, for legacy packages:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;
Auth_Type=OAuth_2.0;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;
Auth_Client_Secret=45kn9Pcyq9pr4lvu123pfl4r57;

As another example, if you are using enhanced packages with server-to-server integration:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;
Auth_Type=Enhanced sts OAuth 2.0;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;
Auth_Client_Secret=45kn9Pcyq9pr4lvu123pfl4r57;

Connecting to Salesforce Marketing Cloud Using Windows Trust Store

The following is the format of a DSN-less connection string for connecting to the Salesforce Marketing Cloud server that requires SSL and uses the Windows trust store:

Driver=Simba SalesforceMarketingCloud Driver;Host=[YourInstanceUrl];Auth_Type=[YourAuthType];Auth_AccessToken=[YourAccessToken];SystemTrustStore=1;

For example:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;Auth_Type=OAuth_2.0;Auth_AccessToken=
1jt9Pcyq8pr3lvu143pfl4r86;SystemTrustStore=1;

The following is the format of a DSN-less connection string for connecting to the Salesforce Marketing Cloud server that requires SSL and uses the path provided in the TrustCertsPath property:

Driver=Simba SalesforceMarketingCloud Driver;Host=[YourInstanceUrl];Auth_Type=[YourAuthType];Auth_AccessToken=[YourAccessToken];SystemTrustStore=0;TrustCertsPath=[YourPath];

For example:

Driver=Simba SalesforceMarketingCloud Driver;Host=www.server1.com;Auth_Type=OAuth_2.0;Auth_AccessToken=
1jt9Pcyq8pr3lvu143pfl4r86;SystemTrustStore=0;TrustCertsPath=C:\Users\JSmith\Desktop\Cert\Salesforce Marketing Cloud.pem;