OLE DB.NET / IB OLEDB 1.0
Native InterBase connections from ADO and OLE DB
1/Apr/2025 08:55:41 am
Browse

Overview

IbOleDb is an OLE DB provider for InterBase SQL Server. It was originally designed for use with ADO and MSDataShape. It can obviously be used by native OLE DB consumers, but the implemented interfaces were chosen to surface key functionality through ADO.

The IbOleDb Rowset object is the owner of the InterBase cursor. InterBase only supports one cursor per statement, so the InterBase statement handle is passed to the Rowset object during rowset creation and passed back to the Command object when the Rowset is released. If multiple simultanious Rowset objects are created by a single Command object then multiple InterBase statements are created, prepared and executed. The first released Rowset will hand its statement handle back to the Command object. The subsequent Rowset objects will have their statement handle discarded when they are released.

Since an InterBase cursor is pretty primitave, the IbOleDb Rowset object is not as feature rich as some other provider implementations. An IbOleDb Rowset is a forward-only, ready-only implementation. For IbOleDb to implement IRowsetScroll or IRowsetLocate, or even just bookmarks it would require caching the entire result set on the client. I choose not to do this for two reasons.

First, it seems like a lot of work to implement features that I'd then have to discourage consumers from using for performance and scalability reasons.

Second, the Micosoft Data Access Components already have a Rowset implementation designed to give minimally compliant OLE DB providers lots of extra functionality. Of couse it has to cache the entire result set to do it. Just choose an ADO client cursor, and you get all the fancy interfaces that the Visual Basic visual data controls require.

The IbOleDb Command object is the owner of the InterBase statement. InterBase supports multiple statements per transaction, so IbOleDb supports multiple Command objects per Session object.

The IbOleDb Session object is the owner of the InterBase tansaction. InterBase supports multiple transactions per connection, so IbOleDb supports multiple Session objects per Data Source Object.

The IbOleDb Data Source Object is the owner of the InterBase connection.

ADO Details

I am a firm believer that OLE DB is the best factored, best designed universal data access model in the world. Unfortunately, the hardships of COM programming make it unwieldly for many. All the QI, AddRef and Release of interfaces makes most people cringe when they see all the all the code it takes just to get some data to the consumer. ADO exists to simplify OLE DB programming. ADO can be used from C++, but then you get tired of all the VariantExchangeType stuff. So ADO is really attractive to VB programmers.

The three main ADO objects we'll discuss are the Connection, Command and Recordset. Thereare some others we might mention, but these map most directly to OLE DB objects and their functionality can be limited by the conformance of the provider.

ADODB.Connection

ADO packages the OLE DB Data Source Object and Session object together in an ADODB.Connection. To make an ADO connection, you really just need to know what properties to set on the OLE DB provider to allow it to connect to the database. See the Data Source Object properties.

ADODB.Command

The ADO Command object wraps the OLE DB Command object.

ADODB.Recordset

OLE DB Details

Data Source Object

Implemented Interfaces

IDBCreateSession
IDBInitialize
IDBInfo
IDBProperties
IPersist
ISupportErrorInfo

Data Source Information Properties

NameRO/RWDefault
Active SessionsRO0
DBMS NameRO"InterBase Server"
Data Source Object Threading ModelRODBPROPVAL_RT_FREETHREAD |
DBPROPVAL_RT_SINGLETHREAD
Isolation LevelsRODBPROPVAL_TI_CURSORSTABILITY |
DBPROPVAL_TI_READCOMMITTED |
DBPROPVAL_TI_REPEATABLEREAD |
DBPROPVAL_TI_SERIALIZABLE |
DBPROPVAL_TI_ISOLATED
Multiple ResultsROFalse
Multiple Storage ObjectsROTrue
OLE DB VersionRO"02.00"
Output Parameter AvailabilityRODBPROPVAL_OA_ATEXECUTE
Pass By Ref AccessorsROFalse
Read-Only Data SourceROFalse
Prepare Abort BehaviorRODBPROPVAL_CB_DELETE
Prepare Commit BehaviorRODBPROPVAL_CB_PRESERVE
Procedure TermRO"stored procedure"
Provider Friendly NameRO"OLE DB Provider for InterBase"
Provider VersionRO"1.1.1709"
Quoted Identifier SensitivityRODBPROPVAL_IC_SENSITIVE
SQL SupportRODBPROPVAL_SQL_ANSI92_ENTRY
Structured StorageRODBPROPVAL_SS_ISEQUENTIALSTREAM
Table TermRO"table"

Data Source Initialization Properties

NameRO/RWDefault
Data SourceRW""
Extended PropertiesRW""
LocationRW""
PasswordRW""
PromptRWDBPROMPT_NOPROMPT
User IDRW""
Window HandleRW0

Session

Implemented Interfaces

IOpenRowset
IGetDataSource
ISessionProperties
ISupportErrorInfo
IDBCreateCommand
ITransaction
TransactionLocal

Session Properties

NameRO/RWDefault
Autocommit Isolation LevelsRWDBPROPVAL_TI_REPEATABLEREAD

Command

Implemented Interfaces

IAccessor
IColumnsInfo
ICommandPrepare
ICommand
ICommandProperties
ICommandText
ICommandWithParameters
IConvertType
ISupportErrorInfo

Rowset Properties

NameRO/RWDefault
Blocking Storage ObjectsROFalse
Command Time OutRO0
Fetch BackwardROFalse
Hold RowsROTrue
IAccessorROTrue
IColumnsInfoROTrue
IColumnsRowsetROFalse
IConvertTypeROTrue
IMultipleResultsROFalse
IRowsetROTrue
IRowsetIdentityROFalse
IRowsetInfoROTrue
IRowsetLocateROFalse
ISequentialStreamROTrue
ISupportErrorInfoROTrue
Maximum Open RowsRO0
Maximum RowsRO0
Memory UsageRO0
Quick RestartROFalse
Row Threading ModelRODBPROPVAL_RT_FREETHREAD |
DBPROPVAL_RT_SINGLETHREAD
Scroll BackwardROFalse
UpdatabilityROFalse
Use BookmarksROFalse

Rowset

Implemented Interfaces

IAccessor
IColumnsInfo
IConvertType
IRowset
IRowsetInfo
ISupportErrorInfo

Future Work Items

Implement IDBSchemaRowset

TABLES

COLUMNS

PROVIDER_TYPES

Implement IColumnRowset

--------------------
©Ralph Curry 2000,
All Rights Reserved.
Logos are trademarked by their respective owners.
SourceForge.net Logo