Easysoft ODBC-SugarCRM Driver User's Guide - Configuration

Configuring the Easysoft ODBC-SugarCRM Driver

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.

Chapter Guide

Configuring the Easysoft ODBC-SugarCRM Driver

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.

Setting Up Data Sources on Unix

There are two ways to set up a data source to your SugarCRM data:

¯ OR ¯

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.


Note

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.


Note

Attribute names in odbc.ini are not case sensitive.


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:

For example:

 [SUGAR_SAMPLE]

 Driver = Easysoft ODBC-Sugar

 User = admin

 Password = mypassword

 Uri = https://sg-richarddemo.demo.sugarcrm.eu

Environment

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.


Note

The shared object file extension (.so) may vary depending on the operating system (.so, .a or .sl).


Establishing a Test Connection

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:

 SQL> select * from Accounts;

¯ OR ¯

 Type help to return a list of tables:

 SQL> help

 

Setting Up Data Sources on Windows

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.

¯ OR ¯

 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.


64-bit Windows

The Easysoft installer program installs both a 32-bit and a 64-bit version of the Easysoft ODBC-SugarCRM Driver. If you want to use a 64-bit ODBC application, you need to use the 64-bit Easysoft ODBC-SugarCRM Driver. If you want to use a 32-bit ODBC application, you need to use the 32-bit Easysoft ODBC-SugarCRM Driver.

There is both a 32-bit and a 64-bit version of ODBC Administrator. The 64-bit ODBC Administrator is located in Control Panel under Administrative tools. To access the 32-bit ODBC Administrator in Windows 7 and earlier, in the Windows Run dialog box, type:

%windir%\syswow64\odbcad32.exe

On Windows 8 and later, both the 32-bit and 64-bit ODBC Administrator are located in Control Panel under Administrative tools: ODBC Data Sources (32-bit) and ODBC Data Sources (64-bit).

Easysoft ODBC-SugarCRM Driver data sources created in the 64-bit ODBC Administrator will specify the 64-bit version of the Easysoft ODBC-SugarCRM Driver. Easysoft ODBC-SugarCRM Driver data sources created in the 32-bit ODBC Administrator will specify the 32-bit version of the Easysoft ODBC-SugarCRM Driver.

If you want to create an Easysoft ODBC-SugarCRM Driver System data source for use with a 64-bit application, use the 64-bit ODBC Administrator. If you want to create an Easysoft ODBC-SugarCRM Driver System data source for use with a 32-bit application, use the 32-bit ODBC Administrator.

For Easysoft ODBC-SugarCRM Driver User data sources, it does not matter which version of the ODBC Administrator that you use.


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:

DIALECT=1|2|3

the value entered may be "1", "2" or "3".

DSN

The name of the User or System data source to be created, as used by the application when calling the SQLConnect or SQLDriverConnect functions.

Interface Value

DSN Dialog Box (Windows)

DSN

odbc.ini file (Unix)

[value]

Connect String

DSN=value

Description

Descriptive text that may be retrieved by certain applications to describe the data source.

Interface Value

DSN Dialog Box (Windows)

Description

odbc.ini file (Unix)

Description=value

Connect String

Not Used

Logon Uri

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.

Interface Value

DSN Dialog Box (Windows)

Logon Uri

odbc.ini file (Unix)

Uri=value

Connect String

URI=value

User Name

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.

Interface Value

DSN Dialog Box (Windows)

User Name

odbc.ini file (Unix)

User = value

Connect String

UID=value

Password

The password for the user you specified with User Name.

To specify the password in the connection string, use PWD rather than Password.



Interface Value

DSN Dialog Box (Windows)

Password

odbc.ini file (Unix)

Password = value

Connect String

PWD=value

Proxy

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:

http://address:port

where addess is the host name or IP address of the proxy server and port is the proxy server port. For example:

http://squid.example.com:8080



Interface Value

DSN Dialog Box (Windows)

Logon Uri

odbc.ini file (Unix)

Proxy=value

Connect String

PROXY=value

Proxy User

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.



Interface Value

DSN Dialog Box (Windows)

Proxy User

odbc.ini file (Unix)

Proxy_User = value

Connect String

PROXY_USER=value

Proxy Password

The password for the user you specified with Proxy User.



Interface Value

DSN Dialog Box (Windows)

Proxy Password

odbc.ini file (Unix)

Proxy_Password = value

Connect String

PROXY_PASSWORD=value

Local Filtering

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.



Interface Value

DSN Dialog Box (Windows)

Local Filtering

odbc.ini file (Unix)

Filter_Local = Yes | No

Connect String

FILTER_LOCAL = Yes | No

Cache Timeout

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.



Interface Value

DSN Dialog Box (Windows)

Cache Timeout

odbc.ini file (Unix)

Query_Timeout = num

Connect String

QUERY_TIMEOUT = num

DisguiseLong

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.



Interface Value

DSN Dialog Box (Windows)

Not Available

odbc.ini file (Unix)

DisguiseLong = Yes | No

Connect String

DISGUISELONG = Yes | No

Flush On Update

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).



Interface Value

DSN Dialog Box (Windows)

Flush On Update

odbc.ini file (Unix)

Flush_On_Update = Yes | No

Connect String

FLUSH_ON_UPDATE = Yes | No

TS As Varchar

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.



Interface Value

DSN Dialog Box (Windows)

TS As Varchar

odbc.ini file (Unix)

TS_As_Varchar = Yes | No

Connect String

TS_AS_VARCHAR = Yes | No

Max Num

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.



Interface Value

DSN Dialog Box (Windows)

Max Num

odbc.ini file (Unix)

Max_Num = num

Connect String

MAX_NUM = num

REST Version

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.



Interface Value

DSN Dialog Box (Windows)

REST Version

odbc.ini file (Unix)

REST_Version = value

Connect String

REST_Version = value

REST Platform

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.



Interface Value

DSN Dialog Box (Windows)

REST Platform

odbc.ini file (Unix)

REST_Platform = value

Connect String

REST_Platform = value

Include Links

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

Domain

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

DSN-less Connections

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.

Windows example:

"DRIVER={Easysoft Sugar ODBC Driver};UID=myuser;PWD=mypassword;URI=https://sg-richrddemo.demo.sugarcrm.eu/"

Linux example:

"DRIVER={Easysoft ODBC-Sugar};UID=myuser;PWD=mypassword;URI=https://sg-richrddemo.demo.sugarcrm.eu/"