MDAC 2.5 SDK - OLE DB Providers
OLE DB Provider for SQL Server


 

Data Source Properties

SQLOLEDB implements data source properties as described in the following table.

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 same 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 busy 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 won't 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™ on a per-connection basis. If a second connection is generated, the commands on the separate connections do not share locks. Care must be taken to ensure that one command does not block another by holding locks on rows requested by the other command.

Each session has a separate connection. The above is also true for creating multiple sessions.


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

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.