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, IConnectionManagerDbObjects
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

SupportDatabases

Indicates if database server does support multiple databases. A database in ETLBox means a schema in MySql.

Declaration
    public override bool SupportDatabases { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.SupportDatabases

SupportProcedures

Indicates if the database supports procedures

Declaration
    public override bool SupportProcedures { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.SupportProcedures

SupportSchemas

Indicates if the database supports schemas In MySql, this is false because the schema here is a database in ETLBox. Use SupportDatabases instead

Declaration
    public override bool SupportSchemas { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.SupportSchemas

Methods

BulkInsert(ITableData)

Performs a bulk insert

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

Batch of data

Overrides

CheckIfTableOrViewExists(string)

Describes how the connection manager can check if a table or view exists

Declaration
    public bool CheckIfTableOrViewExists(string unquotatedFullName)
Parameters
TypeNameDescription
stringunquotatedFullName
Returns
TypeDescription
bool

True if the table or view exists

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

PrepareBulkInsert(string)

Performs preparations needed to improved performance of a bulk insert operation

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

ReadTableDefinition(ObjectNameDescriptor)

Describe how the table meta data can be read from the database

Declaration
    public TableDefinition ReadTableDefinition(ObjectNameDescriptor TN)
Parameters
TypeNameDescription
ObjectNameDescriptorTN

The formatted table name

Returns
TypeDescription
TableDefinition

The definition of the table, containing column names, types, etc.

Implements