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.
Inheritance
Inherited Members
Namespace: ETLBox.Odbc
Assembly: ETLBox.Odbc.dll
Syntax
Examples
ControlFlow.DefaultDbConnection =
new AccessOdbcConnectionManager(new OdbcConnectionString(
"Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\DB\Test.mdb"));
Constructors
AccessOdbcConnectionManager()
Declaration
AccessOdbcConnectionManager(OdbcConnectionString)
Declaration
Parameters
Type | Name | Description |
---|---|---|
OdbcConnectionString | connectionString |
AccessOdbcConnectionManager(string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | connectionString |
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
Property Value
Type | Description |
---|---|
string |
Methods
BulkInsert(ITableData)
Performs a bulk insert
Declaration
Parameters
Type | Name | Description |
---|---|---|
ITableData | data | Batch of data |
Overrides
CleanUpBulkInsert(string)
Called after the whole bulk insert operation to change back settings made to improve bulk insert performance
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | tablename |
Overrides
Clone()
Cretes a clone of the current connection manager
Declaration
Returns
Type | Description |
---|---|
IConnectionManager | A instance copy of the current connection manager |
Overrides
GetSchema(string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | tableName |
Returns
Type | Description |
---|---|
TableDefinition |
Overrides
PrepareBulkInsert(string)
Performs preparations needed to improved performance of a bulk insert operation
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | tablename |