The Easysoft ODBC-SugarCRM Driver is installed on the computer where your applications are running. ODBC applications access ODBC drivers through the ODBC Driver Manager and a data source. The data source tells the Driver Manager which ODBC driver to load, which SugarCRM server to connect to and how to connect to it. This chapter describes how to create data sources, use DSN-less connections and configure the Easysoft ODBC-SugarCRM Driver.
Before setting up a data source, you must have successfully installed the Easysoft ODBC-SugarCRM Driver.
For Easysoft ODBC-SugarCRM Driver installation instructions, see Installation.
This section describes how to configure the Easysoft ODBC-SugarCRM Driver to connect to SugarCRM by using a data source or a DSN-less connection string. The section assumes you are, or are able to consult with, a database administrator.
There are two ways to set up a data source to your SugarCRM data:
By default, the Easysoft ODBC-SugarCRM Driver installation creates a SYSTEM data source named [SUGAR_SAMPLE]. If you are using the unixODBC included in the Easysoft ODBC-SugarCRM Driver distribution, the SYSTEM odbc.ini file is in /etc.
If you built unixODBC yourself, or installed it from some other source, SYSTEM data sources are stored in the path specified with the configure option --sysconfdir=directory. If sysconfdir was not specified when unixODBC was configured and built, it defaults to /usr/local/etc.
If you accepted the default choices when installing the Easysoft ODBC-SugarCRM Driver, USER data sources must be created and edited in $HOME/.odbc.ini.
To display the directory where unixODBC stores SYSTEM and USER data sources, type odbcinst -j. By default, you must be logged in as root to edit a SYSTEM data source defined in /etc/odbc.ini. |
You can either edit the sample data source or create new data sources.
Each section of the odbc.ini file starts with a data source name in square brackets [ ] followed by a number of attribute=value pairs.
The Driver attribute identifies the ODBC driver in the odbcinst.ini file to use for a data source.
When the Easysoft ODBC-SugarCRM Driver is installed into unixODBC, it places an Easysoft ODBC-Sugar entry in odbcinst.ini. For Easysoft ODBC-SugarCRM Driver data sources therefore, you need to include a Driver = Easysoft ODBC-Sugar entry.
To configure a SugarCRM data source, in your odbc.ini file, you need to specify:
Uri = https://sg-richarddemo.demo.sugarcrm.eu
The Easysoft ODBC-SugarCRM Driver must be able to find the following shared objects, which are installed during the Easysoft ODBC-SugarCRM Driver installation:
By default, this is located in /usr/local/easysoft/unixODBC/lib.
By default, this is located in /usr/local/easysoft/lib.
By default, this is located in /usr/local/easysoft/lib.
You may need to set and export LD_LIBRARY_PATH, SHLIB_PATH or LIBPATH (depending on your operating system and run-time linker) to include the directories where libodbcinst.so, libeslicshr.so and libessupp.so are located.
The shared object file extension (.so) may vary depending on the operating system (.so, .a or .sl). |
The isql query tool lets you test your Easysoft ODBC-SugarCRM Driver data sources.
To test the Easysoft ODBC-SugarCRM Driver connection
1. Change directory into /usr/local/easysoft/unixODBC/bin.
2. Type ./isql.sh -v data_source, where data_source is the name of the target data source.
3. At the prompt, type an SQL query. For example:
Type help to return a list of tables:
To connect an ODBC application on a Windows machine to a SugarCRM instance:
1. Open ODBC Data Source Administrator:
The ODBC Data Source Administrator dialog box is displayed:
2. Select the User DSN tab to set up a data source that only you can access.
Select the System DSN tab to create a data source which is available to anyone who logs on to this Windows machine.
3. Click Add... to add a new data source.
The Create New Data Source dialog box displays a list of drivers:
4. Select Easysoft ODBC-SugarCRM Driver and click Finish.
The DSN Setup dialog box is displayed:
For details of the attributes that can be set on this dialog box, see Attribute Fields.
This section lists the attributes which can be set for the Easysoft ODBC-SugarCRM Driver in a table showing:
Attributes which are text fields are displayed as value.
Attributes which are logical fields can contain either 0 (to set to off) or 1 (to set to on) and are displayed as "0|1".
If an attribute can contain one of several specific values then each possible entry is displayed and separated by a pipe symbol.
For example, in the statement:
the value entered may be "1", "2" or "3".
The name of the User or System data source to be created, as used by the application when calling the SQLConnect or SQLDriverConnect functions.
Descriptive text that may be retrieved by certain applications to describe the data source.
The URI of the SugarCRM server. This is the URI that you enter into your Web browser's address box. For example, https://sg-richarddemo.demo/sugarcrm.eu/.You should not need to change the default value for this attribute.
The name of your SugarCRM user.
To specify the user name in the connection string, use UID rather than User. For more information about specifying Easysoft ODBC-SugarCRM Driver attributes in the connection string, see DSN-less Connections.
The password for the user you specified with User Name.
To specify the password in the connection string, use PWD rather than Password.
If you use a proxy server connect to SugarCRM, use the Proxy attribute to specify this server's details. The Proxy attribute has the following format:
where addess is the host name or IP address of the proxy server and port is the proxy server port. For example:
If your proxy server has authentication enabled, use this attribute to supply a user name that can connect to the proxy server.
The Easysoft ODBC-SugarCRM Driver supports the Basic and Digest proxy authentication schemes.
The password for the user you specified with Proxy User.
When ON (checked or set to "Yes"), the Easysoft ODBC-SugarCRM Driver increases its preferred batch size for queries, which alters the number of SugarCRM API calls it makes. SugarCRM may create batches that are larger or smaller than the requested size to maximise performance.
There is no one correct setting for Local Filtering, it depends on how your application executes its queries. You may find that Local FIltering increases query performance for one application and decreases performance for another.
By default, Local Filtering is OFF.
The time in minutes that SugarCRM records wil be stored in the Easysoft ODBC-SugarCRM Driver's cache. The default timeout is 1 minute. If you set the timeout to 0, the Easysoft ODBC-SugarCRM Driver will not cache records.
To reduce SugarCRM API usage and reduce the amount of data retrieved over the network, the Easysoft ODBC-SugarCRM Driver caches SugarCRM records. By default, a record will remain in the cache until the timeout has elapsed.
Note that any changes to the record that happen at the SugarCRM end will not be reflected in the cached copy until the cache is refreshed (i.e. the timeout expires and the record is fetched again.) If a cached record is changed by the Easysoft ODBC-SugarCRM Driver, the cache is refreshed to reflect this change.
When ON (set to Yes), the Easysoft ODBC-SugarCRM Driver describes SQL_LONGVARCHAR fields as SQL_VARCHAR fields and SQL_LONGVARBINARY fields as SQL_VARBINARY fields. The maximum length the driver returns for such fields is 2000.
By default DisguiseLong is ON.
Whether the Easysoft ODBC-SugarCRM Driver flushes its cache when it is used to update or delete SugarCRM data. When this setting is enabled, the effect of your changes will apply in your current session. For example, you enable this attribute and delete a record. If you then do a select in the same session, the record will no longer be present in the result set, If you do the same with Flush On Update turned off, the result set contain the deleted record until the Easysoft ODBC-SugarCRM Driver cache expires or you reconnect your application (for example, you restart your SQL Server instance).
When ON (set to Yes), the Easysoft ODBC-SugarCRM Driver reports datetime and datetimecombo SugarCRM fields as SQL_WVARCHAR. When OFF (set to No), the Easysoft ODBC-SugarCRM Driver reports datetime and datetimecombo SugarCRM fields as SQL_TIMESTAMP. By default, TS AS Varchar is OFF.
The maximum number of records to return for each Rest API request the Easysoft ODBC-SugarCRM Driver makes. The default value for this attribute is 1000.
The Easysoft ODBC-SugarCRM Driver uses the SugarCRM Rest API to query and update SugarCRM data. The driver includes the Rest API version in its API requests. The Rest API version is initialised to the current API (at the time when the driver was built). If this is not the same as your version, use this attribute to change the API version.
The Rest API platform. By default, this is set to base. The platform you specify may affect what SugarCRM tables (modules) are available to the Easysoft ODBC-SugarCRM Driver. For example, the mobile platform exposes fewer tables to the Easysoft ODBC-SugarCRM Driver than does the base platform.
Enable this attribute to include links fields in the result set. For example, if you enable Include Links, the Accounts_Product_Templates column becomes available in the Accounts table.
Interface | Value |
---|---|
DSN Dialog Box (Windows) |
Include Links |
odbc.ini file (Unix) |
Include_Links = Yes | No |
Connect String |
INCLUDE_LINKS = Yes | No |
The domain portion of your SugarCRM user name (if it is in the form of an email address). If you are configuring a data source for use with an Oracle Heterogeneous Service agent (HSODBC or DG4ODBC), you need to use both the User Name and Domain attributes to supply your user name. For example, if your SugarCRM user name is myuser@mydomain, you would specify it in your data source like this:
User = myuser Domain = mydomain
Omit the @ symbol.
Interface | Value |
---|---|
DSN Dialog Box (Windows) |
Domain |
odbc.ini file (Unix) |
Domain = value |
Connect String |
DOMAIN = value |
In addition to using a data source, you can also connect to a database by using a DSN-less connection string of the form:
SQLDriverConnect(..."DRIVER={Easysoft ODBC-Sugar Driver};
UID=user;PWD=password;URI=URI"...)
where user and password are a valid SugarCRM user name and password and URI is the URI of the SugarCRM instance that you want to connect to. You need to use the Easysoft Sugar ODBC Driver (Windows) or Easysoft ODBC-Sugar (Linux) DRIVER keyword to identify the Easysoft ODBC-SugarCRM Driver.
Other Easysoft ODBC-SugarCRM Driver attribute settings, as described in Setting Up Data Sources on Unix, can be added to the connection string using the same PARAMETER=value; format.
"DRIVER={Easysoft Sugar ODBC Driver};UID=myuser;PWD=mypassword;URI=https://sg-richrddemo.demo.sugarcrm.eu/"
"DRIVER={Easysoft ODBC-Sugar};UID=myuser;PWD=mypassword;URI=https://sg-richrddemo.demo.sugarcrm.eu/"