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.
The placeholders in the examples are defined as follows, in alphabetical order:
- [YourAccessToken] is your OAuth 2.0 access token.
- [YourAccountScope] is the comma-separated list of scopes associated with your Zoho application. For a complete list of the supported scopes, see "Scopes" in the Zoho CRM Online Help: https://www.zoho.com/crm/developer/docs/api/oauth-overview.html#scopes.
- [YourAccountsURL] is the domain-specific Zoho Accounts URL to generate access and refresh tokens. For complete list of domain-specific Zoho Accounts URLs, see "Access and Refresh Tokens" in the Zoho CRM Online Help: https://www.zoho.com/crm/developer/docs/api/access-refresh.html.
- [YourClientID] is the client ID associated with your Zoho application.
- [YourClientSecret] is the client secret associated with your Zoho application.
- [YourPath] is the full path of the
.pem
file containing trusted CA certificates for verifying the server during SSL authentication. - [YourRedirectUri] is redirect URI associated with your Zoho application.
Connecting to Zoho 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 Zoho using an access token:
Driver=Simba Zoho ODBC Driver;Host=[Host];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];
For example:
Driver=Simba Zoho ODBC Driver;Host=www.zohoapis.com;Auth_Type=Access Token;Auth_AccessToken=kP9PcyQ7prK2LwUMZMpFQ4R+8vw;
Connecting to Zoho Using Your Zoho Application Information
You can connect to the data source using your Zoho application information through SQLBrowseConnect only. The connector initiates an OAuth 2.0 authentication flow based on your application information, 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 Zoho using your Zoho application information:
Driver=Simba Zoho ODBC Driver;Host=[Host];Auth_Type=OAuth_2.0;Auth_BaseRedirectUri=[YourRedirectUri];Auth_Client_ID=[YourClientID];Auth_Client_Secret=[YourClientSecret];Auth_Scope=[YourAccountScope];Accounts_URL=[YourAccountsURL];
For example:
Driver=Simba Zoho ODBC Driver;Host=www.zohoapis.com;
Auth_Type=OAuth_2.0;Auth_BaseRedirectUri=http://localhost:1234;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;Auth_Client_Secret=
MIIEowIBAAKCAQEA18f3PhzSxNF8kSHGphg9WWR8iXj;Auth_Scope=ZohoCRM.settings.ALL;Accounts_URL=https://accounts.zoho.com;
Access tokens are valid for a limited amount of time only. If you provide an Auth_AccessToken
value and a refresh token in addition to your Zoho application credentials, the connector can refresh the access token when it expires. Note that, in this case, the Auth_AccessToken
value can be any placeholder value.
For example:
Driver=Simba Zoho ODBC Driver;Host=www.zohoapis.com;
Auth_Type=OAuth_2.0;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;Auth_Client_Secret=
MIIEowIBAAKCAQEA18f3PhzSxNF8kSHGphg9WWR8iXj;Auth_RefreshToken=rP78cyQ7prE7LwUerMpFQ4Y+98w;Auth_AccessToken=kP9PcyQ7prK2LwUMZMpFQ4R+8vw;Accounts_URL=https://accounts.zoho.com;
Connecting to Zoho Using Windows Trust Store
The following is the format of a DSN-less connection string for connecting to the Zoho server that requires SSL and uses the Windows trust store:
Driver=Simba Zoho ODBC Driver;Host=[Host];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];SystemTrustStore=1;
For example:
Driver=Simba Zoho ODBC Driver;Host=www.zohoapis.com;Auth_Type=OAuth_2.0;Auth_AccessToken=
kN9PcyQ9prK4LvL4R+lVE=;SystemTrustStore=1;
The following is the format of a DSN-less connection string for connecting to the Zoho server that requires SSL and uses the path provided in the TrustCertsPath
property:
Driver=Simba Zoho ODBC Driver;Host=[Host];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];SystemTrustStore=0;TrustCertsPath=[YourPath];
For example:
Driver=Simba Zoho ODBC Driver;Host=www.zohoapis.com;Auth_Type=OAuth_2.0;Auth_AccessToken=
kN9PcyQ9prK4LvL4R+lVE=;SystemTrustStore=0;TrustCertsPath=C:\Users\JSmith\Desktop\Cert\Zoho.pem;