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.

Inheritance
System.Object
DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>
AccessOdbcConnectionManager
Implements
IConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction>
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.Connection
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
System.StringconnectionString

Properties

ConnectionManagerType

The database type for the connection manager.

Declaration
    public override ConnectionManagerType ConnectionManagerType { get; protected set; }
Property Value
TypeDescription
ConnectionManagerType
Overrides

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
System.String

QB

The quotation begin character that is used in the database. E.g. SqlServer uses: '[' and Postgres: '"'

Declaration
    public override string QB { get; protected set; }
Property Value
TypeDescription
System.String
Overrides

QE

The quotation end character that is used in the database. E.g. SqlServer uses: ']' and Postgres: '"'

Declaration
    public override string QE { get; protected set; }
Property Value
TypeDescription
System.String
Overrides

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
System.Boolean
Overrides
ETLBox.Connection.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
System.Boolean
Overrides
ETLBox.Connection.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
System.Boolean
Overrides
ETLBox.Connection.DbConnectionManager<System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcTransaction, System.Data.Odbc.OdbcParameter>.SupportSchemas

Methods

BulkDelete(ITableData)

Performs a bulk delete

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

Batch of data

Overrides

BulkInsert(ITableData)

Performs a bulk insert

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

Batch of data

Overrides

BulkUpdate(ITableData, ICollection<String>, ICollection<String>)

Performs a bulk update

Declaration
    public override void BulkUpdate(ITableData data, ICollection<string> setColumnNames, ICollection<string> joinColumnNames)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

System.Collections.Generic.ICollection<System.String>setColumnNames
System.Collections.Generic.ICollection<System.String>joinColumnNames
Overrides

CheckIfTableOrViewExists(String)

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

Declaration
    public bool CheckIfTableOrViewExists(string unquotatedFullName)
Parameters
TypeNameDescription
System.StringunquotatedFullName
Returns
TypeDescription
System.Boolean

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
System.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
System.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

System.IDisposable