<?xml version="1.0" encoding="gb2312"?>

<!-- RSS generated by oioj.net on 4/16/2004 ; 感谢LeXRus提供 RSS 2.0 文档; 此文件可自由使用，但请保留此行信息 --> 
<!-- Source download URL: http://blogger.org.cn/blog/rss2.asp       -->
<rss version="2.0">

<channel>
<title>czguang的博客</title>
<link>http://blogger.org.cn/blog/blog.asp?name=czguang</link>
<description>czguang的博客</description>
<copyright>blogger.org.cn</copyright>
<generator>W3CHINA Blog</generator>
<webMaster>webmaster@blogger.org.cn</webMaster>
<item>
<title><![CDATA[OLE DB Programmer's Reference]]></title>
<link>http://blogger.org.cn/blog/more.asp?name=czguang&amp;id=1772</link>
<author>czguang</author>
<pubDate>2005/1/11 15:35:16</pubDate>
<description><![CDATA[转载自: <A href="ms-help://MS.MSDNQTR.2003FEB.2052/oledb/htm/olprcore_chapter19_8.htm" target=_blank>ms-help://MS.MSDNQTR.2003FEB.2052/oledb/htm/olprcore_chapter19_8.htm</A><BR><BR>
<DIV id=scrbanner>
<DIV id=bannerrow1>
<TABLE class=bannerparthead cellSpacing=0>
<TBODY>
<TR id=hdr>
<TD class="bannerparthead td" noWrap>OLE DB Programmer's Reference</TD>
<TD vAlign=center><A href="ms-help://MS.MSDNQTR.2003FEB.2052/oledb/htm/olprcore_chapter19_8.htm#Feedback"><IMG style="CURSOR: hand" onclick=startFeedback(SDKFeedB) alt="" hspace=15 src="ms-help://MS.MSDNQTR.2003FEB.2052/oledb/stylesheets/mailto.gif" align=right name=feedb></A></TD></TR></TBODY></TABLE></DIV></DIV>
<DIV id=scrtext valign="bottom">
<H1 class=dtH1><A name=oledboverriding_provider_service_defaults></A>Overriding Provider Service Defaults</H1>
<P>The provider's registry value for OLEDB_SERVICES is returned as the default value for the DBPROP_INIT_OLEDBSERVICES initialization property on the data source object.</P>
<P>As long as the registry entry exists, the provider's objects will be aggregated and the consumer can override the provider's default setting for enabled services by setting the DBPROP_INIT_OLEDBSERVICES property prior to initialization. To enable or disable a particular service, the consumer will usually get the current value of the DBPROP_INIT_OLEDBSERVICES property, set or clear the bit for the particular property to be enabled or disabled, and reset the property. DBPROP_INIT_OLEDBSERVICES can be set directly in OLE DB or in the connection string passed to ADO or <B>IDataInitialize::GetDatasource</B>.</P>
<P>Performance can be tuned using DBPROPVAL_OS_AGR_AFTERSESSION. When off, aggregation beyond the session level is disabled, resulting in improved performance. The setting is ignored when non–session level services, such as the Client Cursor Engine, are used.</P>
<P>The corresponding values to enable or disable individual services are listed in the following tables. Note that the Client Cursor Engine is excluded; ADO invokes the Client Cursor Engine independent of these OLE DB Services.</P>
<DIV class=tablediv>
<TABLE class=dtTABLE cellSpacing=0>
<TBODY>
<TR vAlign=top>
<TH width="49%"><BR>Default services enabled</TH>
<TH width="51%">DBPROP_INIT_OLEDBSERVICES<BR>property value</TH></TR>
<TR vAlign=top>
<TD width="49%">All services (default)</TD>
<TD width="51%">DBPROPVAL_OS_ENABLEALL</TD></TR>
<TR vAlign=top>
<TD width="49%">All except pooling and automatic transaction enlistment</TD>
<TD width="51%">(DBPROPVAL_OS_ENABLEALL &amp; ~DBPROPVAL_OS_TXNENLISTMENT &amp; ~DBPROPVAL_OS_RESOURCEPOOLING)</TD></TR>
<TR vAlign=top>
<TD width="49%">All except pooling</TD>
<TD width="51%">(DBPROPVAL_OS_ENABLEALL &amp;<BR>~DBPROPVAL_OS_RESOURCEPOOLING)</TD></TR>
<TR vAlign=top>
<TD width="49%">All except automatic transaction enlistment</TD>
<TD width="51%">(DBPROPVAL_OS_ENABLEALL &amp;<BR>~DBPROPVAL_OS_TXNENLISTMENT)</TD></TR>
<TR vAlign=top>
<TD width="49%">All except Client Cursor Engine</TD>
<TD width="51%">(DBPROPVAL_OS_ENABLEALL &amp; ~DBPROPVAL_OS_CLIENTCURSOR)</TD></TR>
<TR vAlign=top>
<TD width="49%">All except pooling, automatic transaction enlistment, and Client Cursor Engine</TD>
<TD width="51%">(DBPROPVAL_OS_ENABLEALL &amp; ~DBPROPVAL_OS_RESOURCEPOOLING &amp; ~DBPROPVAL_OS_TXNENLISTMENT &amp; ~DBPROPVAL_OS_CLIENTCURSOR)</TD></TR>
<TR vAlign=top>
<TD width="49%">Pooling and automatic transaction enlistment only, session level aggregation only </TD>
<TD width="51%">DBPROPVAL_OS_TXNENLISTMENT &amp; DBPROPVAL_OS_RESOURCEPOOLING</TD></TR>
<TR vAlign=top>
<TD width="49%">No services</TD>
<TD width="51%">DBPROPVAL_OS_DISABLEALL</TD></TR></TBODY></TABLE></DIV>
<DIV class=tablediv>
<TABLE class=dtTABLE cellSpacing=0>
<TBODY>
<TR vAlign=top>
<TH width="49%">Default services enabled</TH>
<TH width="51%">Value in connection string</TH></TR>
<TR vAlign=top>
<TD width="49%">All services (default)</TD>
<TD width="51%">"OLE DB Services = -1;"</TD></TR>
<TR vAlign=top>
<TD width="49%">All except pooling and automatic transaction enlistment</TD>
<TD width="51%">"OLE DB Services = -4;"</TD></TR>
<TR vAlign=top>
<TD width="49%">All except Client Cursor Engine</TD>
<TD width="51%">"OLE DB Services = -5;"</TD></TR>
<TR vAlign=top>
<TD width="49%">All except pooling, automatic transaction enlistment, and Client Cursor Engine</TD>
<TD width="51%">"OLE DB Services = -8;"</TD></TR>
<TR vAlign=top>
<TD width="49%">Pooling and automatic transaction enlistment only, session level aggregation only </TD>
<TD width="51%">"OLE DB Services = 3;"</TD></TR>
<TR vAlign=top>
<TD width="49%">No services</TD>
<TD width="51%">"OLE DB Services = 0;"</TD></TR></TBODY></TABLE></DIV>
<BLOCKQUOTE class=dtBlock><B class=le>Note&nbsp;&nbsp;&nbsp;</B>If the registry entry does not exist for the provider, the Component Managers will not aggregate the provider's objects and no services will be enabled, even if explicitly requested by the consumer.</BLOCKQUOTE>
<H4><A name=feedback></A></H4><SPAN id=SDKFeedB></SPAN></DIV>
<P align=center><A href="ms-help://MS.MSDNQTR.2003FEB.2052/oledb/htm/oledb_legalese.htm">&copy; 1998-2003 Microsoft Corporation. All rights reserved.</A></P><!12303>]]></description>
</item>
</channel>
</rss>