Access ODBC Driver Getting Started Guide
How to connect to Microsoft Access from Linux and Unix.
This guide shows you how to download, install and license the Access ODBC driver.
If you are evaluating the Access ODBC driver, the guide will show you how to obtain a free trial license.
Before You Begin
Is the Access database file (.mdb or .accdb) located on the Access ODBC driver machine? If the database file is located on a remote Windows share, your system administrator needs to mount the remote directory on the Access ODBC driver machine. Refer to the Access ODBC Driver User’s Guide for help with this.
Prerequisite Software
If Windows users also access the database file you want to open with the Access ODBC driver, the libsmbclient library is required. Your system administrator needs to install libsmbclient, which is part of the Samba suite, on the Access ODBC driver machine.
What You Need To Know
Obtain this information from your system administrator:
- The path to the database file on the Access ODBC Driver machine.
If the database file is located on a Windows or Samba share, obtain this information:
- The name or IP address of the machine on which the share is located.
- The share name.
- The subdirectory in which the database file is located (if applicable).
- The path to the libsmbclient library on the Access ODBC driver machine.
Step 1: Download the Access ODBC Driver Distribution
-
Log in at http://www.easysoft.com.
If you have not yet done so, you need to register first. On the registration form, an asterisk (*) indicates that a field is mandatory.
- Download the Easysoft ODBC-Access Driver distribution for your Unix platform.
- Save the distribution file to a temporary directory on the machine where you want to install the Access ODBC driver.
Step 2: Install the Access ODBC Driver
Note You need root
access on the machine where you want to install the Access ODBC driver.
- Log in to your Unix system and
cd
into the directory where you downloaded the Access ODBC driver distribution. For example:cd /tmp
- Unpack the distribution file:
tar -xvf odbc-access-version-platform.tar
Replace version and platform with the version number and platform contained in the distribution file name. For example, to unpack the 32-bit Linux distribution:
tar -xvf odbc-access-1.0.0-linux-x86-glibc.tar
-
cd
into the directory created by unpacking the distribution file. For example:cd odbc-access-1.0.0-linux-x86-glibc
- To start the installation, as
root
, type:./install
- Accept the default choices throughout the installation by pressing RETURN. To accept the terms of the Easysoft End User License Agreement, type
Yes
. At certain points in the installation, the installation script pauses to report its progress. To continue to the next stage, press RETURN. - When prompted to choose a product to license, choose the Access ODBC driver by typing its option number:
[0] Exit [1] View existing licenses [2] ODBC-Access Driver V1.0 Please choose the product you would like a license for by entering its item number or enter one of the other options. Option: 2
Next, you need to supply:
- Your full name
- Your company name
- An email contact address. This must be the email address you registered on the Easysoft web site.
- Your telephone number (you need to specify this if you telephone the license request to us).
- Your fax number (you need to specify this if you fax the license request to us).
- A reference number. When applying for a trial license just press ENTER. This field is used to enter a reference number we will supply you for full (paid) licenses.
The License Client asks you to choose a method for obtaining the license. To obtain a license automatically, you need to be connected to the Internet and allow outgoing connections to
license.easysoft.com
on port 8884. If you are not connected to the Internet or do not allow outgoing connections through port 8884, the License Client can create a license request file which you can:- Enter at http://www.easysoft.com/support/licensing/trial_license.html to obtain your license.
- Supply to Easysoft by mail, fax or telephone.
If you choose option [2], the license request is written to a file named license_request.txt and you should exit the License Client (option [0]) and complete the installation. Once you have mailed, faxed or telephoned the license request to us, we will return a license key. Add this to the end of the file
/usr/local/easysoft/license/licenses
.At the end of the installation, you will have installed and licensed the Access ODBC driver, installed the unixODBC Driver Manager and created an ODBC data source.
- Set and export the LD_LIBRARY_PATH environment variable:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/easysoft/access:/usr/local/easysoft/lib export LD_LIBRARY_PATH
Note On AIX, replace LD_LIBRARY_PATH with LIBPATH. On HP-UX, replace LD_LIBRARY_PATH with SHLIB_PATH.
Step 3: Connect to an Access ODBC Driver Data Source
- You need to create an Access ODBC Driver data source. The Access ODBC driver installation creates a sample data source named
ACCESS_SAMPLE
that you can use as a starting point. - As root, open
/etc/odbc.ini
in a text editor. - To locate the sample data source, search for
[ACCESS_SAMPLE]
. - Change these attribute values:
Attribute Value mdbfile The path to the database file on the Access ODBC driver machine. For example: mdbfile = /home/myuser/ms_access/Northwind.mdb
–Or–
mdbfile = /home/samba/ms_access/Northwind 2007.accdb
–Or–
mdbfile = /mnt/access_windows/Northwind.mdb
readonly If you normally open the database file for read-only access (so that you view the database but not change it), set the readonly
attribute toyes
. Otherwise set this attribute tono
.If the database file is located on either a Samba share or a Windows share that has been mounted on the Access ODBC driver machine, change these attribute values:
Attribute Value smbpath The SMB URL for the database file. Use this syntax for the SMB URL: smb://host/share/path/filename
where:
host is the name or IP address of the machine on which the share is located.
share is the share name.
path specifies any subdirectories under share.
filename is the database file name, which should be the same one as specified by the
mdbfile
attribute.For example:
smbpath = smb://access_odbc_driver_machine/accounts_share/ms_access/Northwind 2007.accdb
–Or–
smbpath = smb://windows_machine/accounts_share/ms_access/Northwind.mdb
smblib The path to the libsmbclient library on the Access ODBC driver machine. For example: smblib = /usr/lib/libsmbclient.so
smbuser If the database file is located on a Windows share, your Windows user name. If the database file is located in a Samba share, the Samba user name that you supply to access the share. smbauth The password for smbuser
.Important When you specify a SMB URL, the Access ODBC Driver uses the libsmbclient library to: let Windows know that it has opened a database file; prevent Windows users from opening a database file it has opened for exclusive access. Without this mechanism, there is the potential for database file corruption when Windows users and Access ODBC Driver users are working simultaneously with same the database.
Example
# This Access ODBC Driver data source opens an Access database that is stored on # a Samba share on the Access ODBC driver machine. The data source opens the # database for shared read/write access; other users can open the database # therefore. [ACCESS_SAMPLE] Driver = Easysoft ODBC-ACCESS mdbfile = /home/samba/accounts_share/ms_access/Northwind.mdb # The SMB URL for the database stored on the Samba share. smbpath = smb://access_odbc_driver_machine/accounts_share/ms_access/Northwind.mdb # The path to the libsmbclient library on the Access ODBC Driver machine smblib = /usr/lib/libsmbclient.so # The user name and password of a Samba user who has read and write access to the # share. smbuser = mysamba_user smbauth = mysamba_password # Opens the database for shared read/write access. readonly = no exclusive = no
- Use
isql
to test the new data source:cd /usr/local/easysoft/unixODBC/bin ./isql -v dsn_name
where
dsn_name
is name of your ODBC data source. If you have just edited the sample Access ODBC driver data source, typeACCESS_SAMPLE
.If you are unable to connect, see the Easysoft ODBC-Access Driver Knowledge Base for help on solving some common connection problems.
- At the prompt, type a select statement or type
help
to display a list of tables. To exit, press RETURN in an empty prompt line.
What Next?
You are now ready to use the Access ODBC driver with your own applications and development tools on your client machine.
Further Support
- The Easysoft ODBC-Access Driver User’s Guide provides detailed installation instructions. This manual is also available as a PDF.
- For help on solving some common connection problems, visit the Easysoft ODBC-Access Driver Knowledge Base.
- To contact the Easysoft support team, send an email message to .