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 Driver Configuration Options.
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:
- [ServerHost] is the endpoint of the Magento server that you are connecting to.
- [YourAccessToken] is a token used to access the Magento data source.
- [YourPassword] is the password corresponding to your user name.
- [YourToken] is your access token.
- [YourUserName] is the user name that you use to access Magento.
- [YourPath] is the full path of the
.pem
file containing trusted CA certificates for verifying the server during SSL authentication.
Connecting to Magento Using an Access Token
The following is the format of a DSN-less connection string for connecting to Magento using an access token:
Driver=Simba Magento ODBC Driver;Host=[ServerHost];
Auth_Type=Access Token;Auth_AccessToken=[YourToken];
For example:
Driver=Simba Magento ODBC Driver;
Host=192.168.222.110/magento3;Auth_Type=Access Token;
Auth_AccessToken=kP9PcyQ7prK2LwUMZMpFQ4R+5VE;
Connecting to Magento Using Your User Name and Password (SQLBrowseConnect only)
The following is the format of a DSN-less connection string for connecting to Magento using your user name and password. The connector retrieves an access token based on your credentials, and then uses the token to authenticate the connection. For more information, see Security and Authentication.
Driver=Simba Magento ODBC Driver;Host=[ServerHost];
Auth_Type=OAuth_2.0;Auth_Client_ID=[YourUserName];
Auth_Client_Secret=[YourPassword];Auth_AccessToken=[YourAccessToken];
For example:
Driver=Simba Magento ODBC Driver;
Host=192.168.222.110/magento3;Auth_Type=OAuth_2.0;
Auth_Client_ID=jsmith;Auth_Client_Secret=simba123;Auth_AccessToken=kN9PcyQ9prK4LvL4R+lVE;
Connecting to Magento Using Windows Trust Store
The following is the format of a DSN-less connection string for connecting to the Magento server that requires SSL and uses the Windows trust store:
Driver=SimbaMagento ODBC Driver;Host=[ServerHost];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];SystemTrustStore=1;
For example:
Driver=SimbaMagento ODBC Driver;Host=192.168.222.110/magento3;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 Magento server that requires SSL and uses the path provided in the TrustCertsPath
property:
Driver=SimbaMagento ODBC Driver;Host=[ServerHost];Auth_Type=Access Token;Auth_AccessToken=[YourAccessToken];SystemTrustStore=0;TrustCertsPath=[YourPath];
For example:
Driver=SimbaMagento ODBC Driver;Host=192.168.222.110/magento3;Auth_AccessToken=
kN9PcyQ9prK4LvL4R+lVE=;SystemTrustStore=0;TrustCertsPath=C:\Users\JSmith\Desktop\Cert\Magento.pem;
Related topics