AccessOdbcConnectionManager

Class AccessOdbcConnectionManager

Connection manager for an ODBC connection to Access databases. This connection manager also is based on ADO.NET. ODBC by default does not support a Bulk Insert - and Access does not support the insert into (...) values (...),(...),(...) syntax. So the following syntax is used

insert into (Col1, Col2,...)
select * from (
  select 'Val1' as Col1 from dummytable
  union all
  select 'Val2' as Col2 from dummytable
  ...
) a;

The dummytable is a special helper table containing only one record.

Inherited Members
Namespace: ETLBox.Odbc
Assembly: ETLBox.Odbc.dll
Syntax
    public class AccessOdbcConnectionManager : OdbcConnectionManager, IConnectionManager<OdbcConnection, OdbcTransaction>, IConnectionManager, IDisposable
Examples
ControlFlow.DefaultDbConnection =
  new AccessOdbcConnectionManager(new OdbcConnectionString(
     "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\DB\Test.mdb"));

Constructors

AccessOdbcConnectionManager()

Declaration
    public AccessOdbcConnectionManager()

AccessOdbcConnectionManager(OdbcConnectionString)

Declaration
    public AccessOdbcConnectionManager(OdbcConnectionString connectionString)
Parameters
TypeNameDescription
OdbcConnectionStringconnectionString

AccessOdbcConnectionManager(string)

Declaration
    public AccessOdbcConnectionManager(string connectionString)
Parameters
TypeNameDescription
stringconnectionString

Properties

DummyTableName

Helper table that needs to be created in order to simulate bulk inserts. Contains only 1 record and is only temporarily created.

Declaration
    public string DummyTableName { get; set; }
Property Value
TypeDescription
string

Methods

BulkInsert(ITableData)

Performs a bulk insert

Declaration
    public override void BulkInsert(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides

CleanUpBulkInsert(string)

Called after the whole bulk insert operation to change back settings made to improve bulk insert performance

Declaration
    public override void CleanUpBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides

Clone()

Cretes a clone of the current connection manager

Declaration
    public override IConnectionManager Clone()
Returns
TypeDescription
IConnectionManager

A instance copy of the current connection manager

Overrides

GetSchema(string)

Declaration
    public override TableDefinition GetSchema(string tableName)
Parameters
TypeNameDescription
stringtableName
Returns
TypeDescription
TableDefinition
Overrides

PrepareBulkInsert(string)

Performs preparations needed to improved performance of a bulk insert operation

Declaration
    public override void PrepareBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides

Implements