Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:- The ITransactionLocal interface is not supported by the 'Microsoft.ACE.OLEDB.12.0' provider.Are there any pre requisites?

Through different API I arrive to the same code with the same parameters

public void Foo(string nprPath, int maxConnections = 3)
{
    var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + nprPath;

    using (var connectionPool = new ConnectionPool(maxConnections, connectionString))
    {
       ....
    }
}

I enter the mefhod with the exact param. One API succeeds and the other throws the following

{"The ITransactionLocal interface is not supported by the 'Microsoft.ACE.OLEDB.12.0' 
provider.Local transactions are unavailable with the current provider."}

Are there any prerequisites to using ACE.OLEDB.12

like image 899
Bick Avatar asked Oct 15 '13 17:10

Bick


1 Answers

You may try to add ";OLE DB Services=-4" to connection string.

Something like this:

var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;OLE DB Services=-4;Data Source=" + nprPath;

Also check this related forum.

EDIT:-

When "OLE DB Services = -4; the it means:-

All except pooling and automatic transaction enlistment

Check the related MSDN

like image 197
Rahul Tripathi Avatar answered Sep 22 '22 17:09

Rahul Tripathi