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
Implements
Inherited Members
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()
Examples
ControlFlow.DefaultDbConnection =
new AccessOdbcConnectionManager(new OdbcConnectionString(
"Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\DB\Test.mdb"));
AccessOdbcConnectionManager(OdbcConnectionString)
Declaration
public AccessOdbcConnectionManager(OdbcConnectionString connectionString)
Parameters
Type | Name | Description |
---|---|---|
OdbcConnectionString | connectionString |
Examples
ControlFlow.DefaultDbConnection =
new AccessOdbcConnectionManager(new OdbcConnectionString(
"Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\DB\Test.mdb"));
AccessOdbcConnectionManager(string)
Declaration
public AccessOdbcConnectionManager(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
string | connectionString |
Examples
ControlFlow.DefaultDbConnection =
new AccessOdbcConnectionManager(new OdbcConnectionString(
"Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\DB\Test.mdb"));
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
Type | Description |
---|---|
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
Type | Description |
---|---|
bool |
Overrides
SupportProcedures
Indicates if the database supports procedures
Declaration
public override bool SupportProcedures { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
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
Type | Description |
---|---|
bool |
Overrides
Methods
BulkInsert(ITableData)
Performs a bulk insert
Declaration
public override void BulkInsert(ITableData data)
Parameters
Type | Name | Description |
---|---|---|
ITableData | data | 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
Type | Name | Description |
---|---|---|
string | unquotatedFullName |
Returns
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
string | tablename |
Overrides
Clone()
Cretes a clone of the current connection manager
Declaration
public override IConnectionManager Clone()
Returns
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
string | tablename |
Overrides
ReadTableDefinition(ObjectNameDescriptor)
Describe how the table meta data can be read from the database
Declaration
public TableDefinition ReadTableDefinition(ObjectNameDescriptor TN)
Parameters
Type | Name | Description |
---|---|---|
ObjectNameDescriptor | TN | The formatted table name |
Returns
Type | Description |
---|---|
TableDefinition | The definition of the table, containing column names, types, etc. |