Data Source Properties

OLE DB and SQL Server

OLE DB and SQL Server

Data Source Properties

SQLOLEDB implements data source properties as follows.

Property ID Description
DBPROP_CURRENTCATALOG R/W: Read/write
Default: None
Description: The value of DBPROP_CURRENTCATALOG reports the current database for a SQLOLEDB session. Setting the property value has the identical effect as setting the current database by using the Transact-SQL USE database statement.
DBPROP_MULTIPLECONNECTIONS R/W: Read/write
Default: VARIANT_TRUE
Description: If the connection is running a command that does not produce a rowset, or produces a rowset that is not a server cursor and you execute another command, a new connection will be created to execute the new command if DBPROP_MULTIPLECONNECTIONS is VARIANT_TRUE.

SQLOLEDB will not create another connection if DBPROP_MULTIPLECONNECTION is VARIANT_FALSE or if a transaction is active on the connection. SQLOLEDB returns DB_E_OBJECTOPEN if DBPROP_MULTIPLECONNECTIONS is VARIANT_FALSE and returns E_FAIL if there is an active transaction. Transactions and locking are managed by Microsoft® SQL Server™ 2000 on a per connection basis. If a second connection is generated, the commands on the separate connections do not share locks. Ensure that one command does not block another by holding locks on rows requested by the other command. This is also true for creating multiple sessions.

Each session has a separate connection.


In the provider-specific property set DBPROPSET_SQLSERVERDATASOURCE, SQLOLEDB defines the following additional data source property.

Property ID Description
SSPROP_ENABLEFASTLOAD R/W: Read/write
Default: VARIANT_FALSE
Description: To bulk copy, SSPROP_ENABLEFASTLOAD property is set to VARIANT_TRUE. With this property set on the data source, the newly created session allows consumer access to the IRowsetFastLoad interface.

If the property is set to VARIANT_FALSE, IRowsetFastLoad interface is available through IopenRowset::OpenRowset by requesting IID_IRowsetFastLoad interface or by setting SSPROP_IRowsetFastLoad to VARIANT_TRUE.