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
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
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 below are defined as follows, in alphabetical order:
- [Endpoint] is the endpoint of the Square server that you are connecting to.
- [RedirectURL] is the redirect URL associated with your Square application.
- [YourAccessToken] is your OAuth 2.0 access token for authenticating to Square.
- [YourAppID] is the application ID associated with your Square application.
- [YourAppSecret] is the application secret associated with your Square application.
- [YourPath] is the full path of the
.pem
file containing trusted CA certificates for verifying the server during SSL authentication.
Connecting to Square Using an Access Token
The following is the format of a DSN-less connection string for connecting to Square using an access token:
Driver=Simba Square ODBC Driver;Host=[Endpoint];Auth_Type=OAuth_2.0;Auth_AccessToken=[YourAccessToken];
For example:
Driver=Simba Square ODBC Driver;Host=simbastore.mysquare.com;Auth_Type=OAuth_2.0;Auth_AccessToken=kN9PcyQ9prK4LvUMMMpFL4R+lVE=;
Connecting to Square Using Your Square Application Information
The following is the format of a DSN-less connection string for connecting to Square using your Square application information. 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.
Driver=Simba Square ODBC Driver;Host=[Endpoint];Auth_Type=OAuth_2.0;Auth_Client_ID=[YourAppID];Auth_Client_Secret=[YourAppSecret];Auth_BaseRedirectUri=[RedirectURL];
For example:
Driver=Simba Square ODBC Driver;Host=simbastore.mysquare.com;Auth_Type=OAuth_2.0;Auth_Client_ID=f145kn9Pcyq9pr4lvumdapfl4rive;Auth_Client_Secret=45kn9Pcyq9pr4lvu123pfl4r57;Auth_BaseRedirectUri=http://localhost:2500;
Access tokens are valid for a limited amount of time only. If you provide a refresh token, the connector can refresh the access token when it expires.
Driver=Simba Square ODBC Driver;Host=connect.squareup.com;Auth_Type=OAuth_2.0;Auth_Client_ID=rdaaw_DzQqeFh;Auth_Client_Secret=RAGaTbcwnHFpT3I86jiYLFm;Auth_ BaseRedirectURI=http://localhost:2500;Auth_RefreshToken=nw02LDX5SGJbi24fDhTK7lIqUp;
Connecting to Square Using Windows Trust Store
The following is the format of a DSN-less connection string for connecting to the Square server that requires SSL and uses the Windows trust store:
Driver=Simba Square ODBC Driver;Host=[Endpoint];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];SystemTrustStore=1;
For example:
Driver=Simba Square ODBC Driver;Host=simbastore.mysquare.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 Square server that requires SSL and uses the path provided in the TrustCertsPath
property:
Driver=Simba Square ODBC Driver;Host=[Endpoint];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];SystemTrustStore=0;TrustCertsPath=[YourPath];
For example:
Driver=Simba Square ODBC Driver;Host=simbastore.mysquare.com;Auth_Type=OAuth_2.0;Auth_AccessToken=
kN9PcyQ9prK4LvL4R+lVE=;SystemTrustStore=0;TrustCertsPath=C:\Users\JSmith\Desktop\Cert\Square.pem;