Skip to main content
A newer version of this page is available. .

AccessConnectionProviderMultiUserThreadSafe Class

Implements an MS Access connection provider that can be used in multi-user and multi-threaded applications.

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public class AccessConnectionProviderMultiUserThreadSafe :
    MarshalByRefObject,
    IDataStore,
    IDataStoreAsync,
    IDataStoreSchemaExplorer,
    IDataStoreForTests,
    ICommandChannel,
    ICommandChannelAsync

Remarks

Unlike the AccessConnectionProvider, the AccessConnectionProviderMultiUserThreadSafe provider can be safely used in multi-user and multi-threaded applications.

The MS Access caches data when modifications are being made to the database. These delayed updates can cause old data to be returned when reading from the database using another connection. The AccessConnectionProviderMultiUserThreadSafe solves these problems by re-creating a connection to the database each time an operation on a database should be carried out. Connecting to the database using this provider is slower than using the AccessConnectionProvider.

See the AccessConnectionProvider topic for more information.

Example

The following code demonstrates how to connect to an MS Access database. The AccessConnectionProvider.GetConnectionString method is called to construct a connection string to the database. It’s then assigned to the XpoDefault.ConnectionString property.

When a connection is about to be established to a database, a session object obtains the connection string from the XpoDefault.ConnectionString property (unless another connection string is supplied directly to the session). This is then used to connect to the database.

using DevExpress.Xpo;
using DevExpress.Xpo.DB;

XpoDefault.ConnectionString = AccessConnectionProvider.GetConnectionString(
    @"c:\Data\nwind.mdb");

Inheritance

Object
MarshalByRefObject
AccessConnectionProviderMultiUserThreadSafe
See Also