Easysoft ODBC-Access Driver User's Guide - Configuration

Configuring the Easysoft ODBC-Access Driver

The Easysoft ODBC-Access 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 and which Access database to connect to. This chapter describes how to create data sources, use DSN-less connections and configure the Easysoft ODBC-Access Driver.

Before setting up a data source, you must have successfully installed the Easysoft ODBC-Access Driver.

For Easysoft ODBC-Access Driver installation instructions, see Installation.

Chapter Guide

Connecting to your Access Database

The Easysoft ODBC-Access Driver is a file-based ODBC driver that communicates directly with the Access database file. The database file must be accessible through the local file system on the machine where the Easysoft ODBC-Access Driver is installed.

Deployment Options

If both Windows and Easysoft ODBC-Access Driver users will need to access the database file you can:

¯ OR ¯

Alternatively, if only Easysoft ODBC-Access Driver users need to access the database file, you should:

Read this section to see which Easysoft ODBC-Access Driver deployment option is appropriate for you.

1.  Where Does Your Database File Need To Be Located?

For performance reasons, you should locate the database file nearest to the applications that use it most intensively. If your Windows applications would be most adversely affected by opening a database file located on a remote machine, locate the database file on Windows. Otherwise, copy the database file to the Easysoft ODBC-Access Driver machine, and, if applicable, use Samba to expose the file to Windows users.

2.  What Platform Do You Need To Access The Database File From?

Linux

Note For read-write access to the database file, you need to use a version of smbmount that can disable local file caching (directio option). There is a performance penalty associated with this option.

You also need to install the libsmbclient library, which the Easysoft ODBC-Access Driver uses to let Windows applications know when it has a database file open and to prevent other users from opening a database file it has opened for exclusive access. libsmbclient is part of the Samba suite.

Unix

Configuring the Easysoft ODBC-Access Driver

This section describes how to configure the Easysoft ODBC-Access Driver to connect to an Access database 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

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

¯ OR ¯

By default, the Easysoft ODBC-Access Driver installation creates a SYSTEM data source named [ACCESS_SAMPLE]. If you are using the unixODBC included in the Easysoft ODBC-Access 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-Access 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-Access Driver is installed into unixODBC, an entry for the driver (Easysoft ODBC-ACCESS) is placed in odbcinst.ini.

For Easysoft ODBC-Access Driver data sources, you need to include a Driver = Easysoft ODBC-ACCESS entry.

To configure an Access data source, in your odbc.ini file, you need to specify:

For example:

 [ACCESS_SAMPLE]

 Driver = Easysoft ODBC-ACCESS

 mdbfile = /home/myuser/ms-access/Northwind.mdb

¯ OR ¯

 [ACCESS_SAMPLE]

 Driver = Easysoft ODBC-ACCESS

 mdbfile = /home/myuser/ms-access/Northwind 2007.accdb

If you are using the Easysoft ODBC-Access Driver to open an database file that Windows users may also be accessing, specify these settings:

For example:

 [ACCESS_SAMPLE_WINDOWS_SHARE]

 Driver = Easysoft ODBC-ACCESS

 mdbfile = /mnt/accounts/access/Northwind.mdb

 smbpath = smb://mswin_machine/accounts/access/Northwind.mdb

 smblib = /usr/lib/libsmbclient.so

 smbuser = mywindows_user

 smbauth = mywindows_password

¯ OR ¯

 [ACCESS_SAMPLE_SAMBA_SHARE]

 Driver = Easysoft ODBC-ACCESS

 mdbfile = /home/samba/sales/access/Northwind.mdb

 smbpath = smb://samba_server/sales/access/Northwind.mdb

 smblib = /usr/lib/libsmbclient.so

 smbuser = my_samba_share_valid_user

 smbauth = my_samba_share_valid_password

 

Attribute Fields

The following attributes may be set in the odbc.ini file:

Attribute Description

Driver = value

The name of the ODBC driver to use with this data source. Set this attribute value to Easysoft ODBC-ACCESS.

Description = value

A single line of descriptive text that may be retrieved by some applications to describe the data source.

mdbfile = value

The path to the Access database file (.mdb or .accdb) on the machine where the Easysoft ODBC-Access Driver is installed.

If the database file is stored on the same machine as the Easysoft ODBC-Access Driver, specify the path to the database file. For example:

# Path to .mdb file stored on

# Easysoft ODBC-Access Driver machine.

mdbfile = /home/myuser/ms_access/Northwind.mdb

¯ OR ¯

# Path to .accdb file stored on

# Easysoft ODBC-Access Driver machine.

mdbfile = /home/samba/ms_access/Northwind 2007.accdb

If the database file is stored on a Windows machine, you need to share the directory where the file is located and then mount the Windows share from the Easysoft ODBC-Access Driver machine. Specify the mounted share's path with mdbfile, along with the remote database file name. For example:

# Local path to .mdb file stored on

# Windows. /mnt/access_windows is local mount

# point for a remote Windows share.

mdbfile = /mnt/access_windows/Northwind.mdb.

dbq = value

The path to the Access database file (.mdb or .accdb) on the machine where the Easysoft ODBC-Access Driver is installed.

The dbq attribute is an alternative to the mdbfile attribute, and is provided for symmetry with Microsoft's Access ODBC driver. You do not need to specify both the dbq and mdbfile attributes in your data source.

smbpath = value

The SMB URL for the database file. This attribute (along with smblib, smbuser and smbauth) is required when you open a database file that Windows users may also be accessing.

Important When you specify a SMB URL, the Easysoft ODBC-Access 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 Easysoft ODBC-Access Driver users are working simultaneously with same the database.

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:

# SMB URL for a .mdb file shared by a Windows machine.

smbpath = smb://mswin_box/accounts/access/Northwind.mdb

# SMB URL for a .accdb file shared from a Unix

# machine through Samba server.

smbpath = smb://unix_box/sales/access/Northwind 2007.accdb

Note that SMB URLs for Samba shares are case sensitive; SMB URLs for Windows shares are not case sensitive.

smblib = value

The path to the libsmbclient library on the machine where the Easysoft ODBC-Access Driver is installed. For example:

smblib = /usr/lib/libsmbclient.so

libsmbclient is part of the Samba suite.

The Easysoft ODBC-Access Driver uses libsmbclient to:

  • Allow Linux and Unix users to safely edit a database file that Windows users may also be accessing.
  • Prevent Windows users from opening a database file it has opened for exclusive access.
  • Prevent users from locking records in Windows that are already locked in the Easysoft driver and vice versa.

smbuser = value

The name of a user who can access the share where the database file is located.

If the database file is stored on a Samba share, specify a Samba user.

If the database file is stored on a Windows share, specify a Windows user.

The user must have either read or read-write permissions for the share. If the user only has read access to the share, set the readonly data source attribute to yes.

smbauth = value

The password for smbuser.

lockfile = value

By default, when you open a database file for shared access, the Easysoft ODBC-Access Driver uses a locking information file named dbfiledir/dbfilename.ldb. For example, if you open a database named Nwind.mdb, the Easysoft ODBC-Access Driver expects a locking information file named Nwind.ldb in the same directory as Nwind.mdb.

Use the lockfile attribute to specify an alternative .ldb file path if directory permissions prevent the Easysoft ODBC-Access Driver from manipulating a .ldb file in the default directory. Specify a directory where all users who connect to this data source have write access to. For example:

lockfile = /tmp/Nwind.ldb

Do not use the lockfile attribute if users may access the database file from Windows at your site. Windows applications access database files through the Jet/Access database engine, which expects the dbfiledir/dbfilename.ldb convention for lock files. There must only be one lock file per database file.

readonly = yes | no

To open the database file for read-only access, set readonly to yes. When opened for read-only access, you can view the Access database, but not change it.

By default, readonly is set to no, which means the Easysoft ODBC-Access Driver opens the database for read-write access.

If you open a database for read-write access without setting the smb* data source attributes, the Easysoft ODBC-Access Driver returns the warning:

read write access without SMB channel can potentially allow corruption of the MDB file

The Easysoft ODBC-Access Driver uses the smb* attributes to allow users to safely edit a database file that Windows users may also be accessing. If your database is shared with Windows users, configure the smb* attributes before opening the database for read-write access. Otherwise, set readonly to yes.

double_precision = num

The decimal precision to return for a double column that's bound as a char. For example:

double_precision = 15

Set this attribute if double column data returned by the Easysoft ODBC-Access Driver does not have the expected number of decimal places.

exclusive = yes | no

To open the database file for exclusive access, set exclusive to yes. By default, exclusive is set to no.

Notes For libsmbclient Users

When you set exclusive to yes, the Easysoft ODBC-Access Driver uses libsmbclient to the mark the database as share mode DENY_ALL. This share mode denies all open requests on the database file, which prevents other users from opening the database while you are connected to the Easysoft ODBC-Access Driver data source.

Note Using share mode DENY_ALL is the only way to prevent Windows users from opening a database that you have opened for exclusive access with the Easysoft ODBC-Access Driver.

To enable the Easysoft ODBC-Access Driver to use libsmbclient, you need to set the smb* attributes in the data source. If you set exclusive to yes without setting the smb* attributes, the Easysoft ODBC-Access Driver cannot prevent other users from opening the database and so returns the warning:

exclusive access without SMB channel can not exclude other access, and can potentially allow corruption of the MDB file

Notes For Non-libsmbclient Users

Setting exclusive to yes prevents other Easysoft ODBC-Access Driver users from opening the database file while you are connected to the Easysoft ODBC-Access Driver data source.

ignore_rel = yes | no

Whether the Easysoft ODBC-Access Driver takes into account any relationships defined for a particular table when doing INSERTs, UPDATEs or DELETEs. For example, with ignore_rel set to yes, the Easysoft ODBC-Access Driver would prevent a record from being deleted if one of its columns was a foreign key for another table.

By default, ignore_rel is set to no.

work_mem_size = value

The size of the memory cache, in megabytes (MB), where the Easysoft ODBC-Access Driver will store rows before storing them on disk.

For example:

work_mem_size = 10

work_dir_path = value

The directory where the Easysoft ODBC-Access Driver temporarily stores result set rows when work_mem_size is exceeded.

For example:

work_dir_path = /tmp

htime_pattern = value

Use htime_pattern to specify the format used for hash (#) quoted date constants in queries. Available formats are:

MDY (month/day/year)

DMY (day/month/year)

YMD (year/month/day)

For example:

htime_pattern = MDY

unicode_map = 0 | 1 | 2

How Easysoft ODBC-Access Driver maps 16-bit characters to 8-bit characters.

The unicode_map attribute affects: TEXT, MEMO and HYPERLINK data in result sets; metadata (column names); DELETE, INSERT INTO, UPDATE statements (TEXT columns only); SQL statement parameters.

Use unicode_map if you experience data loss/corruption when working with character data.

The available values for the unicode_map attribute are:

0 When retrieving data, the Easysoft ODBC-Access Driver preserves the low 8 bits of the encoded character and discards the high 8 bits. When unicode_map is set to 0, some applications may replace non-ASCII characters retrieved from the Access database with question marks (?).

1 When retrieving data, the Easysoft ODBC-Access Driver preserves ASCII characters and replaces non-ASCII characters with question marks. For example, Forêts d'érables becomes For?ts d'?rables.

2 The Easysoft ODBC-Access Driver converts characters to UTF-8 when retrieving data and from UTF-8 when submitting data (for example, inserting data into TEXT columns).

By default, unicode_map is set to 0.

Figure 3: Easysoft ODBC-Access Driver data source settings.

Environment

The Easysoft ODBC-Access Driver must be able to find the following shared objects, which are installed during the Easysoft ODBC-Access 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.

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-Access Driver data sources.

To test the Easysoft ODBC-Access Driver connection

1.  Change directory into /usr/local/easysoft/unixODBC/bin.

2.  Type ./isql -v data_source, where data_source is the name of the Easysoft ODBC-Access Driver data source.

 If you are unable to connect, see Troubleshooting Database Connection Problems for help on solving some common connection problems.

3.  At the prompt, type an SQL query. For example:

 SQL> select * from mytable;

¯ OR ¯

 Type help to return a list of tables:

 SQL> help

 

Example: Connecting To An Access Database On Windows From Linux

1.  On the Easysoft ODBC-Access Driver machine, use smbmount to mount the Windows share where the database file is located.

 For example:

 # smbmount //mywindowsmachine/myshare /mylinuxmountpoint -o username=mywindowsuser,rw,directio

 Important For read-write access to the database, you must specify the directio option when mounting the share. Check the man page for your version of smbmount to see whether it supports the directio option. Specifying directio turns off inode data caching on files opened on the mount. The Easysoft ODBC-Access Driver relies on this functionality when managing concurrent access to the database file.

 When mounting the share, you need to supply the user name and password of a Windows user who has read, write, create and delete privileges for the share. When testing the Easysoft ODBC-Access Driver with a database file located in a Windows Vista share, this requirement equated to these Windows permissions:

Share permissions Shared folder permissions

Change

Read

Modify

Read

Write

Figure 4: Windows Vista permissions needed by mount user.

 These permissions allow the Easysoft ODBC-Access Driver to write to or create a locking information file (.ldb).

2.  Configure the Easysoft ODBC-Access Driver data source.

Example data sources:

# This Easysoft ODBC-Access Driver data source opens an Access

# database that is stored on a Windows share. The data source

# opens the database for shared read/write access; other users can

# open the database therefore.

[ACCESS_SAMPLE_WINDOWS_SHARE]

Driver = Easysoft ODBC-ACCESS

# The Windows share (accounts) has been attached under /mnt on the

# Easysoft ODBC-Access Driver machine.

mdbfile = /mnt/accounts/access/Northwind.mdb

# The smb* attributes allow the Easysoft ODBC-Access Driver to

# manage concurrent access to the database.

# The SMB URL for the database on the Windows share.

smbpath = smb://mswin_machine/accounts/access/Northwind.mdb

# The path to the SMB client library on the

# Easysoft ODBC-Access Driver machine

smblib = /usr/lib/libsmbclient.so

# The user name and password of a Windows user who has read and

# write privileges to the share.

smbuser = mywindows_user

smbauth = mywindows_password

# Opens the database for shared read/write access.

readonly = no

exclusive = no

¯ OR ¯

# This data source opens the same Access database for exclusive

# access; the Easysoft ODBC-Access Driver will prevent other

# users from accessing the database, therefore.

[ACCESS_SAMPLE_WINDOWS_SHARE]

Driver = Easysoft ODBC-ACCESS

mdbfile = /mnt/accounts/access/Northwind.mdb

smbpath = smb://mswin_machine/accounts/access/Northwind.mdb

smblib = /usr/lib/libsmbclient.so

# The user name and password of a Windows user who can access the

# share and who has read and write privileges to the .mdb file.

smbuser = mywindows_user

smbauth = mywindows_password

# Opens the database for exclusive read/write access.

readonly = no

exclusive = yes

¯ OR ¯

# This data source opens the same Access database for read-only

# access; the Easysoft ODBC-Access Driver will prevent its users

# from making updates to the database, therefore.

[ACCESS_SAMPLE_WINDOWS_SHARE]

Driver = Easysoft ODBC-ACCESS

mdbfile = /mnt/accounts/access/Northwind.mdb

smbpath = smb://mswin_machine/accounts/access/Northwind.mdb

smblib = /usr/lib/libsmbclient.so

# The user name and password of a Windows user who has read

# privilege to the share.

smbuser = mywindows_user

smbauth = mywindows_password

# Opens the database for read-only access.

readonly = yes

exclusive = no

For more information about Easysoft ODBC-Access Driver data source attributes, see Attribute Fields.

Example: Connecting To An Access Database Located On A Samba Share

1.  Copy the Access database file to a Samba share on the Easysoft ODBC-Access Driver machine.

The Easysoft ODBC-Access Driver requires the following Samba configuration options to be set for the share in which the database file is located.

Option Value

oplocks

yes

This is the default setting.

posix locking

yes

This is the default setting.

blocking locks

yes

This is the default setting.

veto oplock files

/*.mdb/*.MDB/*.ldb/*.LDB/*.accdb/*.ACCDB

Figure 5: smb.conf settings for the Access database file share.

2.  Configure the Easysoft ODBC-Access Driver data source.

Example data sources:

# This Easysoft ODBC-Access Driver data source opens an Access

# database that is stored on a Samba share. The data source

# opens the database for shared read/write access; other users can

# open the database therefore.

[ACCESS_SAMPLE_SAMBA_SHARE]

Driver = Easysoft ODBC-ACCESS

mdbfile = /home/samba/sales/access/Northwind.mdb

# The smb* attributes allow the Easysoft ODBC-Access Driver to

# manage concurrent access to the database.

# The SMB URL for the database on the Samba share.

smbpath = smb://samba_server/sales/access/Northwind.mdb

# The path to the SMB client library on the

# Easysoft ODBC-Access Driver machine

smblib = /usr/lib/libsmbclient.so

# The user name and password of a Samba user who has read/write

# access to the share.

smbuser = my_samba_share_valid_user

smbauth = my_samba_share_valid_password

# Opens the database for shared read/write access.

readonly = no

exclusive = no

¯ OR ¯

# This data source opens the same Access database for exclusive

# access; the Easysoft ODBC-Access Driver will prevent other

# users from accessing the database, therefore.

[ACCESS_SAMPLE_SAMBA_SHARE]

Driver = Easysoft ODBC-ACCESS

mdbfile = /home/samba/sales/access/Northwind.mdb

smbpath = smb://samba_server/sales/access/Northwind.mdb

smblib = /usr/lib/libsmbclient.so

# The user name and password of a Samba user who has read/write

# access to the share.

smbuser = my_samba_share_valid_user

smbauth = my_samba_share_valid_password

# Opens the database for exclusive read/write access.

readonly = no

exclusive = yes

¯ OR ¯

# This data source opens the same Access database for read-only

# access; the Easysoft ODBC-Access Driver will prevent its users

# from making updates to the database, therefore.

[ACCESS_SAMPLE_SAMBA_SHARE]

Driver = Easysoft ODBC-ACCESS

mdbfile = /home/samba/sales/access/Northwind.mdb

smbpath = smb://samba_server/sales/access/Northwind.mdb

smblib = /usr/lib/libsmbclient.so

# The user name and password of a Samba user who has read

# access to the share.

smbuser = my_samba_share_valid_user

smbauth = my_samba_share_valid_password

# Opens the database for read-only access.

readonly = yes

exclusive = no

Troubleshooting Database Connection Problems

This section lists some common connection problems and their solutions.

Failed to open MDB file

The Easysoft ODBC-Access Driver can open either a local or remote Access database file (.mdb or .accdb). The path to the database file is specified in the Easysoft ODBC-Access Driver data source in /etc/odbc.ini.

In the Easysoft ODBC-Access Driver data source, check the mdbfile attribute value.

Use ls to check that the mdbfile attribute in your data source specifies a valid path and that the directory is accessible.

If the ls command output contains "permission denied", contact your administrator. The directory containing the database file needs to be accessible (execute permission set) to you.

If the path is not valid, check with your administrator whether the database file is located on another machine. (The Easysoft ODBC-Access Driver can open a database file that is located on a Windows share.) If the database file is remote, use the mount command to check whether the share has been attached on the Easysoft ODBC-Access Driver machine. There should be an entry in the mount command output that corresponds with the directory specified with mdbfile. For example:

$ mount

/dev/sda3 on / type ext3 (rw,errors=remount-ro)

proc on /proc type proc (rw,noexec,nosuid,nodev)

/sys on /sys type sysfs (rw,noexec,nosuid,nodev)

.

.

.

//mywindowsmachine/myshare on /mnt/myshare type smbfs (rw)

$ grep mdbfile /etc/odbc.ini

mdbfile = /mnt/myshare/Northwind.mdb

If the mount command does not show the mount point specified in the mdbfile attribute, consult with your administrator. The share on which the database file is located needs to be mounted.

If the database file is on a Windows share, the user specified when mounting the share needs to have read, write, create and delete permissions for the share. When testing the Easysoft ODBC-Access Driver with a database file located in a Windows Vista share, this requirement equated to these Windows permissions:

Share permissions Shared folder permissions

Change

Read

Modify

Read

Write

If the database file is located on Unix, the Easysoft ODBC-Access Driver will also return a "Failed to open MDB file" if:

1.  The user running the application that is connecting to the data source only has read access to a local database file.

¯ OR ¯

 The user specified by smbuser only has read access to a database file located on a Samba share.

2.  The readonly attribute in the data source is set to yes. (Change this attribute's value to no and try again.)

Failed to open SMB channel

The Easysoft ODBC-Access Driver uses the libsmbclient library, which is part of the Samba suite, to:

Without this mechanism, there is the potential for database file corruption when Windows users and Easysoft ODBC-Access Driver users are working with the database specified by mdbfile.

To configure the driver for use with libsmbclient you use the smb* attributes in the driver data source.

If the "Failed to open SMB channel" error contains "file not found", check the smbpath attribute in the data source. The smbpath attribute needs to specify the SMB URL for the database file specified with mdbfile. The SMB URL has the format smb://host/share/path/filename.

In the following example, a remote Access database named Northwind.mdb is located on the Easysoft ODBC-Access Driver machine in /mnt/myshare_mountdir. The mount command shows that /mnt/myshare_mountdir is the mount point for a share named myshare on a machine named myremotemachine.

$ grep mdbfile /etc/odbc.ini

mdbfile = /mnt/myshare_mountdir/Northwind.mdb

$ mount

//myremotemachine/myshare on /mnt/myshare_mountdir type smbfs (rw)

The SMB URL for the database file would therefore be:

smb://myremotemachine/myshare/Northwind.mdb

If the "Failed to open SMB channel" error contains "errno=13", check the smbuser and smbauth attributes in the data source.

If the database file is located on a Samba share, the smbuser and smbauth attributes need to specify the user name and password for a Samba user (created with Samba tools such as smbpasswd) who has read access to the share. To open a database file for read-write access (readonly data source attribute set to no), the Samba user also needs write access to the share).

If the database file is located in a Windows share, the smbuser and smbauth attributes need to specify the user name and password for a Windows user who can access the share. If smbuser only has read privilege to the database file (as opposed to read and write), the readonly attribute in the data source needs to be set to yes. Otherwise, an "errno=13" error will be returned.

Could not open/create lock file, check sharing permissions

To allow its users to safely edit a database file that Windows users may also be accessing and updating, the Easysoft ODBC-Access Driver uses a locking information file (.ldb).

The driver uses a .ldb file to:

The Easysoft ODBC-Access Driver may have to create and delete a .ldb file as well as write to it. If directory permissions prevent the Easysoft ODBC-Access Driver from writing to/creating a .ldb file, the driver may return a "Could not open/create lock file, check sharing permissions" error.

If you get this error when opening a database file that Windows users do not require access to, specify an alternative .ldb file directory with the lockfile data source attribute. Specify a directory where you and other users who connect to the data source have write access to. For example:

lockfile = /tmp/Nwind.ldb

Permissions Summary

This table lists the various permissions that may need to be set to allow the Easysoft ODBC-Access Driver to open your Access database file (.mdb or .accdb).



Permission Applies to Type Notes

execute

write

database file directory

Local Unix permissions on Easysoft ODBC-Access Driver machine

The local directory from which the database file is opened must be accessible (execute permission set) by the user who is connecting to the data source.

The local directory must also be writeable by the user who is connecting to the data source if the database file is opened for shared access (exclusive data source attribute set to no).

read

write

database file

Local Unix permissions on Easysoft ODBC-Access Driver machine

The database file must be readable (read permission set) by the user who is connecting to the data source. If the database file is opened for read/write access (readonly data source attribute set to no), the database file must also be writeable (write permission set) by this user.

read

write

Samba share containing database file

Samba

These permissions are only applicable if the database file is located on a Samba share on Unix.

The Samba user specified by the smbuser data source attribute needs to have read access to the share. If the database file is opened for read/write access (readonly data source attribute set to no), this user must also have write access to the share.

read

write

create

delete

Windows share containing database file

Windows

These permissions are only applicable if the database file is located on a Windows share.

The Windows user whose authentication details are supplied when mounting the share needs to have read, write, create and delete privileges on the share. Note that on some versions of Windows, the create and delete privileges may be replaced by the modify privilege.

read

write

Windows share containing database file

Windows

These permissions are only applicable if the database file is located on a Windows share.

The Windows user specified by the smbuser data source attribute needs to have read privilege on the share. If the database file is opened for read/write access (readonly data source attribute set to no), this user must also have write privilege.

Figure 6: Access database file and directory permissions.

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-ACCESS};

MDBFILE=path;"...)

where path is the path to the database file on the Easysoft ODBC-Access Driver machine.

Other Easysoft ODBC-Access Driver attribute settings, as described in Setting Up Data Sources, can be added to the connection string using the same PARAMETER=value; format. For example:

"DRIVER={Easysoft ODBC-ACCESS};MDBFILE=/home/myuser/ms_access/Northwind.mdb;"