初始化和授權屬性Initialization and Authorization Properties

適用於: 是SQL Server 是Azure SQL Database 是Azure SQL 資料倉儲 是平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure SQL Data Warehouse yesParallel Data Warehouse

SQL ServerSQL Server Native Client OLE DB 提供者會將 OLE DB 初始化和授權屬性解譯如下:The SQL ServerSQL Server Native Client OLE DB provider interprets OLE DB initialization and authorization properties as follows:

屬性識別碼Property ID 描述Description
DBPROP_AUTH_CACHE_AUTHINFODBPROP_AUTH_CACHE_AUTHINFO SQL ServerSQL Server Native Client OLE DB 提供者不會快取驗證資訊。The SQL ServerSQL Server Native Client OLE DB provider does not cache authentication information.

SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_AUTH_ENCRYPT_PASSWORDDBPROP_AUTH_ENCRYPT_PASSWORD SQL ServerSQL Server Native Client OLE DB 提供者會使用標準MicrosoftMicrosoftSQL ServerSQL Server安全性機制來隱藏密碼。The SQL ServerSQL Server Native Client OLE DB provider uses standard MicrosoftMicrosoftSQL ServerSQL Server security mechanisms to conceal passwords.

SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_AUTH_INTEGRATEDDBPROP_AUTH_INTEGRATED 如果 DBPROP_AUTH_INTEGRATED 設定為 NULL 指標、Null 字串,或 'SSPI' VT_BSTR 值,SQL ServerSQL Server Native Client OLE DB 提供者會使用 Windows 驗證模式來授權使用者對於 DBPROP_INIT_DATASOURCE 和 DBPROP_INIT_CATALOG 屬性指定之 SQL ServerSQL Server 資料庫的存取。If DBPROP_AUTH_INTEGRATED is set to a NULL pointer, a null string, or 'SSPI' VT_BSTR value, the SQL ServerSQL Server Native Client OLE DB provider uses Windows Authentication Mode to authorize user access to the SQL ServerSQL Server database specified by the DBPROP_INIT_DATASOURCE and DBPROP_INIT_CATALOG properties.

如果設定為 VT_EMPTY (預設值),則會使用 SQL ServerSQL Server 安全性。If it is set to VT_EMPTY (the default), SQL ServerSQL Server security is used. SQL ServerSQL Server 登入和密碼是在 DBPROP_AUTH_USERID 和 DBPROP_AUTH_PASSWORD 屬性中指定的。The SQL ServerSQL Server login and password are specified in the DBPROP_AUTH_USERID and DBPROP_AUTH_PASSWORD properties.
DBPROP_AUTH_MASK_PASSWORDDBPROP_AUTH_MASK_PASSWORD SQL ServerSQL Server Native Client OLE DB 提供者會使用標準的 SQL ServerSQL Server 安全性機制來隱藏密碼。The SQL ServerSQL Server Native Client OLE DB provider uses standard SQL ServerSQL Server security mechanisms to conceal passwords.

SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_AUTH_PASSWORDDBPROP_AUTH_PASSWORD 指派給 SQL ServerSQL Server 登入的密碼。Password assigned to a SQL ServerSQL Server login. 選取 SQL ServerSQL Server 驗證來授權對於 SQL ServerSQL Server 資料庫的存取時,會使用此屬性。This property is used when SQL ServerSQL Server Authentication is selected for authorizing access to a SQL ServerSQL Server database.
DBPROP_AUTH_PERSIST_ENCRYPTEDDBPROP_AUTH_PERSIST_ENCRYPTED 保存時,SQL ServerSQL Server Native Client OLE DB 提供者不會加密驗證資訊。The SQL ServerSQL Server Native Client OLE DB provider does not encrypt authentication information when persisted.

SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFODBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO SQL ServerSQL Server Native Client OLE DB 提供者會保存驗證值,包括密碼的影像 (如果有要求)。The SQL ServerSQL Server Native Client OLE DB provider persists authentication values, including an image of a password, if requested to do so. 不提供任何加密。No encryption is provided.
DBPROP_AUTH_USERIDDBPROP_AUTH_USERID SQL ServerSQL Server 登入。login. 選取 SQL ServerSQL Server 驗證來授權對於 SQL ServerSQL Server 資料庫的存取時,會使用此屬性。This property is used when SQL ServerSQL Server Authentication is selected for authorizing access to a SQL ServerSQL Server database.
DBPROP_INIT_ASYNCHDBPROP_INIT_ASYNCH SQL ServerSQL Server Native Client OLE DB 提供者支援非同步初始化。The SQL ServerSQL Server Native Client OLE DB provider supports asynchronous initiation.

在 DBPROP_INIT_ASYNCH 屬性中設定 DBPROPVAL_ASYNCH_INITIALIZE 位元會使 IDBInitialize::Initialize 成為未封鎖的呼叫。Setting the DBPROPVAL_ASYNCH_INITIALIZE bit in the DBPROP_INIT_ASYNCH property causes IDBInitialize::Initialize to become a non-blocking call. 如需詳細資訊,請參閱 < 正在執行非同步作業For more information, see Performing Asynchronous Operations.
DBPROP_INIT_CATALOGDBPROP_INIT_CATALOG 所連接之現有 SQL ServerSQL Server 資料庫的名稱。Name of an existing SQL ServerSQL Server database to which to connect.
DBPROP_INIT_DATASOURCEDBPROP_INIT_DATASOURCE 執行 MicrosoftMicrosoftSQL ServerSQL Server 執行個體之伺服器的網路名稱。Network name of a server running an instance of MicrosoftMicrosoftSQL ServerSQL Server. 當有多個 SQL ServerSQL Server 執行個體在電腦上執行時,如果要連線到特定的 SQL ServerSQL Server 執行個體,DBPROP_INIT_DATASOURCE 值會指定為 \\ServerName\InstanceNameIf there are multiple instances of SQL ServerSQL Server running on the computer, in order to connect to a specific instance of SQL ServerSQL Server the value DBPROP_INIT_DATASOURCE is specified as \\ServerName\InstanceName. 逸出序列 \\ 會用於反斜線本身。The escape sequence \\ is used for backslash itself.
DBPROP_INIT_GENERALTIMEOUTDBPROP_INIT_GENERALTIMEOUT 表示要求 (而非資料來源初始化和命令執行) 逾時前的秒數。值為 0 表示無限逾時。透過網路連線或者在分散或交易情況下工作的提供者可以支援此屬性,在出現長時間執行的要求時,通知編列的元件逾時。Indicates the number of seconds before a request, other than data source initialization and command execution, times out. A value of 0 indicates an infinite time-out. Providers that work over network connections or in distributed or transacted scenarios can support this property to advise an enlisted component to time-out in the event of a long-running request. 資料來源初始化和命令執行的逾時仍然個別受到 DBPROP_INIT_TIMEOUT 和 DBPROP_COMMANDTIMEOUT 的管理。Time-outs for data source initialization and command execution remain governed by DBPROP_INIT_TIMEOUT and DBPROP_COMMANDTIMEOUT, respectively.

DBPROP_INIT_GENERALTIMEOUT 是唯讀的,如果使用者嘗試它,就會傳回 DBPROPSTATUS_NOTSETTABLE 的 dwstatus 錯誤。DBPROP_INIT_GENERALTIMEOUT is read-only, and if one tries to set it the dwstatus error of DBPROPSTATUS_NOTSETTABLE is returned.
DBPROP_INIT_HWNDDBPROP_INIT_HWND 來自呼叫應用程式的 Windows 控制代碼。The Windows handle from the calling application. 在允許提示初始化屬性時顯示的初始化對話方塊需要有效的視窗控制代碼。A valid window handle is required for the initialization dialog box displayed when prompting for initialization properties is allowed.
DBPROP_INIT_IMPERSONATION_LEVELDBPROP_INIT_IMPERSONATION_LEVEL SQL ServerSQL Server Native Client OLE DB 提供者不支援模擬層級調整。The SQL ServerSQL Server Native Client OLE DB provider does not support impersonation level adjustment.

SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_INIT_LCIDDBPROP_INIT_LCID 如果不支援地區設定識別碼,或者沒有安裝在用戶端上,SQL ServerSQL Server Native Client OLE DB 提供者會驗證地區設定識別碼,並傳回錯誤。The SQL ServerSQL Server Native Client OLE DB provider validates the locale ID and returns an error if the locale ID is not supported or is not installed on the client.
DBPROP_INIT_LOCATIONDBPROP_INIT_LOCATION SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_INIT_MODEDBPROP_INIT_MODE SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_INIT_PROMPTDBPROP_INIT_PROMPT SQL ServerSQL Server Native Client OLE DB 提供者支援資料來源初始化的所有提示模式。The SQL ServerSQL Server Native Client OLE DB provider supports all prompting modes for data source initialization. SQL ServerSQL Server Native Client OLE DB 提供者會使用 DBPROMPT_NOPROMPT 做為屬性的預設值。The SQL ServerSQL Server Native Client OLE DB provider uses DBPROMPT_NOPROMPT as its default setting for the property.
DBPROP_INIT_PROTECTION_LEVELDBPROP_INIT_PROTECTION_LEVEL SQL ServerSQL Server Native Client OLE DB 提供者不支援 SQL ServerSQL Server 執行個體連接的保護等級。The SQL ServerSQL Server Native Client OLE DB provider does not support a protection level on connections to instances of SQL ServerSQL Server.

SQL ServerSQL Server Native Client OLE DB 提供者會在嘗試設定屬性值時,傳回 DB_S_ERRORSOCCURRED。The SQL ServerSQL Server Native Client OLE DB provider returns DB_S_ERRORSOCCURRED on an attempt to set the property value. DBPROP 結構的 dwStatus 成員表示 DBPROPSTATUS_NOTSUPPORTED。The dwStatus member of the DBPROP Structure indicates DBPROPSTATUS_NOTSUPPORTED.
DBPROP_INIT_PROVIDERSTRINGDBPROP_INIT_PROVIDERSTRING 請參閱本主題稍後的 SQL ServerSQL Server Native Client OLE DB 提供者字串。See the SQL ServerSQL Server Native Client OLE DB provider string later in this topic.
DBPROP_INIT_TIMEOUTDBPROP_INIT_TIMEOUT 如果無法在指定的秒數內建立 SQL ServerSQL Server 執行個體的連接,SQL ServerSQL Server Native Client OLE DB 提供者會在初始化時傳回錯誤。The SQL ServerSQL Server Native Client OLE DB provider returns an error on initialization if a connection to the instance of SQL ServerSQL Server cannot be established within the number of seconds specified.

在提供者專用的屬性集 DBPROPSET_SQLSERVERDBINIT 中, SQL ServerSQL Server Native Client OLE DB 提供者會定義這些額外的初始化屬性。In the provider-specific property set DBPROPSET_SQLSERVERDBINIT, the SQL ServerSQL Server Native Client OLE DB provider defines these additional initialization properties.

屬性識別碼Property ID 描述Description
SSPROP_AUTH_OLD_PASSWORDSSPROP_AUTH_OLD_PASSWORD 類型:VT_BSTRType: VT_BSTR

R/W:寫入R/W: Write

預設:VT_EMPTYDefault: VT_EMPTY

描述:目前或過期的密碼。Description: The current or expired password. 如需詳細資訊,請參閱 < 變更密碼以程式設計方式For more information, see Changing Passwords Programmatically.
SSPROP_INIT_APPNAMESSPROP_INIT_APPNAME 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:用戶端應用程式名稱。Description: The client application name.
SSPROP_INIT_AUTOTRANSLATESSPROP_INIT_AUTOTRANSLATE 類型:VT_BOOLType: VT_BOOL

R/W:讀取/寫入R/W: Read/write

預設:VARIANT_TRUEDefault: VARIANT_TRUE

描述:OEM/ANSI 字元轉換。Description: OEM/ANSI character conversion.

VARIANT_TRUE:SQL ServerSQL Server Native Client OLE DB 提供者會轉譯傳送用戶端與伺服器之間透過 Unicode 進行轉換至相符的字碼頁,在用戶端與伺服器之間的擴充的字元問題降至最低的 ANSI 字元字串:VARIANT_TRUE: The SQL ServerSQL Server Native Client OLE DB provider translates ANSI character strings sent between the client and server by converting through Unicode to minimize problems in matching extended characters between the code pages on the client and the server:

傳送到 SQL ServerSQL Servercharvarchartext 變數、參數或資料行之執行個體的用戶端 DBTYPE_STR 資料會使用用戶端的 ANSI 字碼頁 (ACP),從字元轉換成 Unicode,然後使用伺服器的 ACP,從 Unicode 轉換成字元。Client DBTYPE_STR data sent to an instance of SQL ServerSQL Serverchar, varchar, or text variable, parameter, or column is converted from character to Unicode using the client ANSI code page (ACP) and then converted from Unicode to character using the ACP of the server.

傳送到用戶端 DBTYPE_STR 變數的 SQL ServerSQL Server charvarchartext 資料會使用伺服器的 ACP,從字元轉換成 Unicode,然後使用用戶端的 ACP,從 Unicode 轉換成字元。SQL ServerSQL Server char, varchar, or text data sent to a client DBTYPE_STR variable is converted from character to Unicode using the server ACP and then converted from Unicode to character using the client ACP.

這些轉換會由 SQL ServerSQL Server Native Client OLE DB 提供者在用戶端上執行。These conversions are performed on the client by the SQL ServerSQL Server Native Client OLE DB provider. 但是在伺服器上使用的相同 ACP 必須也可以在用戶端上使用。This requires that the same ACP used on the server be available on the client.

這些設定對於進行下列傳輸時所發生的轉換沒有作用:These settings have no effect on the conversions that occur for these transfers:

傳送到伺服器之 charvarchartext 的 Unicode DBTYPE_WSTR 用戶端資料。Unicode DBTYPE_WSTR client data sent to char, varchar, or text on the server.

傳送到用戶端之 Unicode DBTYPE_WSTR 變數的 charvarchartext 伺服器資料。char, varchar, or text server data sent to a Unicode DBTYPE_WSTR variable on the client.

傳送到伺服器之 ncharnvarcharntext 的 ANSI DBTYPE_STR 用戶端資料。ANSI DBTYPE_STR client data sent to Unicode nchar, nvarchar, or ntext on the server.

傳送到用戶端之 ANSI DBTYPE_STR 變數的 Unicode charvarchartext 伺服器資料。Unicode char, varchar, or text server data sent to an ANSI DBTYPE_STR variable on the client.

VARIANT_FALSE:SQL ServerSQL Server Native Client OLE DB 提供者不會執行字元轉譯。VARIANT_FALSE: The SQL ServerSQL Server Native Client OLE DB provider does not perform character translations.

SQL ServerSQL Server Native Client OLE DB 提供者不會轉譯傳送到用戶端 ANSI 字元 DBTYPE_STR 資料charvarchar,或文字變數,在伺服器上的資料行或參數。The SQL ServerSQL Server Native Client OLE DB provider does not translate client ANSI character DBTYPE_STR data sent to char, varchar, or text variables, parameters, or columns on the server. 在從伺服器傳送到用戶端之 DBTYPE_STR 變數的 charvarchartext 資料上不會執行任何轉譯。No translation is performed on char, varchar, or text data sent from the server to DBTYPE_STR variables on the client.

如果用戶端和 SQL ServerSQL Server 執行個體使用不同的 ACP,可能會將擴充字元解譯錯誤。If the client and the instance of SQL ServerSQL Server are using different ACPs, extended characters can be misinterpreted.
SSPROP_INIT_CURRENTLANGUAGESSPROP_INIT_CURRENTLANGUAGE 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:ASQL ServerSQL Server語言名稱。Description: A SQL ServerSQL Server language name. 識別系統訊息選取與格式所使用的語言。Identifies the language used for system message selection and formatting. 此語言必須安裝在執行 SQL ServerSQL Server 執行個體的電腦上,否則資料初始化會失敗。The language must be installed on the computer running an instance of SQL ServerSQL Server or data source initialization fails.
SSPROP_INIT_DATATYPECOMPATIBILITYSSPROP_INIT_DATATYPECOMPATIBILITY 類型:VT_UI2Type: VT_UI2

R/W:讀取/寫入R/W: Read/write

預設:0Default: 0

描述:可讓資料類型之間的相容性SQL ServerSQL Server和 ActiveX Data Object (ADO) 應用程式。Description: Enables data type compatibility between SQL ServerSQL Server and ActiveX Data Object (ADO) applications. 如果使用預設值 0,資料類型處理會預設為提供者所使用的資料類型。If the default value of 0 is used, data type handling defaults to that used by the provider. 如果使用值 80,資料類型處理僅會使用 SQL Server 2000 (8.x)SQL Server 2000 (8.x) 資料類型。If the value of 80 is used, data type handling uses only SQL Server 2000 (8.x)SQL Server 2000 (8.x) data types. 如需詳細資訊,請參閱 < 使用與 SQL Server Native Client 的 ADOFor more information, see Using ADO with SQL Server Native Client.
SSPROP_INIT_ENCRYPTSSPROP_INIT_ENCRYPT 類型:VT_BOOLType: VT_BOOL

R/W:讀取/寫入R/W: Read/Write

預設:VARIANT_FALSEDefault: VARIANT_FALSE

描述:若要加密透過網路所要的資料,SSPROP_INIT_ENCRYPT 屬性會設定為 VARIANT_TRUE。Description: To encrypt the data going over the network, SSPROP_INIT_ENCRYPT property is set to VARIANT_TRUE.

如果 [啟用通訊協定加密] 開啟,不管 SSPROP_INIT_ENCRYPT 的設定為何,永遠會進行加密。If Enable Protocol Encryption is on, encryption will always occur, regardless of the setting of SSPROP_INIT_ENCRYPT. 如果關閉此設定,而且 SSPROP_INIT_ENCRYPT 設定為 VARIANT_TRUE,則會進行加密。If it is off and SSPROP_INIT_ENCRYPT is set to VARIANT_TRUE, then encryption will occur.

如果關閉 [啟用通訊協定加密],而且 SSPROP_INIT_ENCRYPT 設定為 VARIANT_FALSE,則不會進行加密。If Enable Protocol Encryption is off and SSPROP_INIT_ENCRYPT is set to VARIANT_FALSE, then no encryption occurs.
SSPROP_INIT_FAILOVERPARTNERSSPROP_INIT_FAILOVERPARTNER 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:指定資料庫鏡像的容錯移轉夥伴名稱。Description: Specifies the name of the failover partner for database mirroring. 這是初始化屬性,而且僅能在初始化之前設定。It is an initialization property and can only be set before initialization. 初始化之後,它會傳回容錯移轉夥伴,如果有的話,則會由主要伺服器傳回。After initialization it will return the failover partner, if any, returned by the primary server.

這可讓智慧型應用程式快取最近決定的備份伺服器,但是此類應用程式應該會注意到此資訊只會在第一次建立 (如果緩衝,則重設) 連接時更新,而且在長期連接後會變成過期。This allows a smart application to cache the most recently determined backup server, but such applications should be aware that the information is only updated when the connection is first established (or reset, if pooled) and can become out of date for long term connections.

建立連接後,應用程式可以查詢此屬性來判斷容錯移轉夥伴的識別。After making the connection, the application can query this attribute to determine the identity of the failover partner. 如果主要伺服器沒有容錯移轉夥伴,此屬性將會傳回空字串。If the primary server has no failover partner this property will return an empty string. 如需詳細資訊,請參閱使用資料庫鏡像For more information, see Using Database Mirroring.
SSPROP_INIT_FILENAMESSPROP_INIT_FILENAME 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:指定可附加資料庫的主要檔案名稱。Description: Specifies the primary file name of an attachable database. 此資料庫會附加,而且變成連接的預設資料庫。This database is attached and becomes the default database for the connection. 若要使用 SSPROP_INIT_FILENAME,您必須將資料庫的名稱指定為初始化屬性 DBPROP_INIT_CATALOG 的值。To use SSPROP_INIT_FILENAME, you must specify the name of the database as the value of the initialization property DBPROP_INIT_CATALOG. 如果資料庫名稱不存在,則會尋找在 SSPROP_INIT_FILENAME 中指定的主要檔案名稱,並以 DBPROP_INIT_CATALOG 中指定的名稱附加該資料庫。If the database name does not exist, then it looks for the primary file name specified in SSPROP_INIT_FILENAME and attaches that database with the name specified in DBPROP_INIT_CATALOG. 如果該資料庫先前已附加,SQL ServerSQL Server 不會重新附加它。If the database was previously attached, SQL ServerSQL Server does not reattach it.
SSPROP_INIT_MARSCONNECTIONSSPROP_INIT_MARSCONNECTION 類型:VT_BOOLType: VT_BOOL

R/W:讀取/寫入R/W: Read/write

預設:VARIANT_FALSEDefault: VARIANT_FALSE

描述:指定連接是否已啟用多個作用中結果集 (MARS)。Description: Specifies if Multiple Active Result Sets (MARS) are enabled for the connection. 在連接到資料庫之前,必須將此選項設定為 True。This option must be set to true before a connection is made to the database. 如需詳細資訊,請參閱使用 Multiple Active Result Sets (MARS)For more information, see Using Multiple Active Result Sets (MARS).
SSPROP_INIT_NETWORKADDRESSSSPROP_INIT_NETWORKADDRESS 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:執行的執行個體之伺服器的網路位址SQL ServerSQL Server用的 DBPROP_INIT_DATASOURCE 屬性所指定。Description: The network address of the server running an instance of SQL ServerSQL Server specified by the DBPROP_INIT_DATASOURCE property.
SSPROP_INIT_NETWORKLIBRARYSSPROP_INIT_NETWORKLIBRARY 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:之網路程式庫 (DLL) 用來通訊的執行個體的名稱SQL ServerSQL ServerDescription: The name of the networklibrary (DLL) used to communicate with an instance of SQL ServerSQL Server. 名稱不得包含路徑或 .dll 副檔名。The name should not include the path or the .dll file name extension.

預設值可以使用 SQL ServerSQL Server 用戶端組態公用程式自訂。The default can be customized using the SQL ServerSQL Server Client Configuration Utility.

注意:這個屬性支援只有 TCP 和具名管道。Note: Only TCP and Named Pipes are supported by this property. 如果您搭配前置詞使用此屬性,結尾有雙前置詞時,會導致錯誤,因為此屬性用來在內部產生前置詞。If you use this property with a prefix, you end up with a double prefix which results in an error, because the property is used to generate a prefix internally.
SSPROP_INIT_PACKETSIZESSPROP_INIT_PACKETSIZE 類型:VT_I4Type: VT_I4

R/W:讀取/寫入R/W: Read/write

描述:網路封包大小 (位元組)。Description: A network packet size in bytes. 封包大小屬性值必須介於 512 和 32,767 之間。The packet size property value must be between 512 and 32,767. 預設的 SQL ServerSQL Server Native Client OLE DB 提供者網路封包大小為 4,096。The default SQL ServerSQL Server Native Client OLE DB provider network packet size is 4,096.
SSPROP_INIT_TAGCOLUMNCOLLATIONSSPROP_INIT_TAGCOLUMNCOLLATION 類型:BOOLType: BOOL

R/W:寫入R/W: Write

預設:FALSEDefault: FALSE

描述:使用伺服器端資料指標時,會使用資料庫更新期間。Description: Is used during a database update when server-side cursors are used. 此屬性會使用從伺服器 (而非用戶端的字碼頁) 取得的定序資訊標記資料。This property tags the data with collation information obtained from the server instead of the code page on the client. 目前只有分散式查詢處理使用此屬性,因為它知道目的地資料的定序,而且會正確轉換該定序。Currently, this property is used only by the distributed query process because it knows the collation of destination data and converts it correctly.
SSPROP_INIT_TRUST_SERVER_CERTIFICATESSPROP_INIT_TRUST_SERVER_CERTIFICATE 類型:VT_BOOLType: VT_BOOL

R/W:讀取/寫入R/W: Read/write

預設:VARIANT_FALSEDefault: VARIANT_FALSE

描述:用來啟用或停用伺服器憑證驗證。Description: Used to enable or disable server certificate validation. 此屬性是讀取/寫入的,但是在建立連接後嘗試設定該屬性將會導致錯誤。This property is read/write, but attempting to set it after a connection has been established will result in an error.

如果將用戶端設定為需要憑證驗證,則會忽略此屬性。This property is ignored if the client is configured to require certificate validation. 不過,即使沒有將用戶端設定為需要加密,而且在用戶端上沒有提供任何憑證,應用程式還是可以將該屬性與 SSPROP_INIT_ENCRYPT 一起使用來確保伺服器的連接經過加密。However, an application can use it together with SSPROP_INIT_ENCRYPT to guarantee that its connection to the server is encrypted, even if the client is configured not to require encryption and no certificate is provisioned on the client.

用戶端應用程式可以在開啟連接之後查詢此屬性,以便判斷使用中的實際加密和驗證設定。Client applications can query this property after a connection has been opened to determine the actual encryption and validation settings in use.

注意:使用沒有憑證驗證的加密提供保護部分網路封包探查,但它無法防止攔截攻擊。Note: Using encryption without certificate validation provides partial protection against packet sniffing, but it does not protect against man-in-the-middle attacks. 它只會允許加密傳送到伺服器的登入和資料,而不會驗證伺服器憑證。It simply allows for encrypting the login and data sent to the server without validating the server certificate.

如需詳細資訊,請參閱使用加密而不需驗證For more information, see Using Encryption Without Validation.
SSPROP_INIT_USEPROCFORPREPSSPROP_INIT_USEPROCFORPREP 類型:VT_I4Type: VT_I4

R/W:讀取/寫入R/W: Read/write

預設:SSPROPVAL_USEPROCFORPREP_ONDefault: SSPROPVAL_USEPROCFORPREP_ON

描述:SQL ServerSQL Server預存程序使用。Description: The SQL ServerSQL Server stored procedure use. 定義 SQL ServerSQL Server 暫存預存程序的用途來支援 ICommandPrepare 介面。Defines the use of SQL ServerSQL Server temporary stored procedures to support the ICommandPrepare interface. 只有在連接到 SQL Server 6.5 時,此屬性才有意義。This property was meaningful only when connecting to SQL Server 6.5. 更新的版本會忽略此屬性。The property is ignored for later versions.

SSPROPVAL_USEPROCFORPREP_OFF:準備命令時,不會建立暫存預存程序。SSPROPVAL_USEPROCFORPREP_OFF: A temporary stored procedure is not created when a command is prepared.

SSPROPVAL_USEPROCFORPREP_ON:準備命令時,會建立暫存預存程序。SSPROPVAL_USEPROCFORPREP_ON: A temporary stored procedure is created when a command is prepared. 釋出工作階段時,會卸除暫存預存程序。The temporary stored procedures are dropped when the session is released.

SSPROPVAL_USEPROCFORPREP_ON_DROP:準備命令時,會建立暫存預存程序。SSPROPVAL_USEPROCFORPREP_ON_DROP: A temporary stored procedure is created when a command is prepared. 使用 ICommandPrepare::Unprepare 取消準備命令時、使用 ICommandText::SetCommandText 指定命令物件的新命令時,或是釋出命令的所有應用程式參考時,會卸除此程序。The procedure is dropped when the command is unprepared with ICommandPrepare::Unprepare, when a new command is specified for the command object with ICommandText::SetCommandText, or when all application references to the command are released.
SSPROP_INIT_WSIDSSPROP_INIT_WSID 類型:VT_BSTRType: VT_BSTR

R/W:讀取/寫入R/W: Read/write

描述:識別工作站的字串。Description: A string identifying the workstation.

在提供者專用的屬性集 DBPROPSET_SQLSERVERDATASOURCEINFO 中, SQL ServerSQL Server Native Client OLE DB 提供者會定義其他屬性,請參閱資料來源資訊屬性如需詳細資訊。In the provider-specific property set DBPROPSET_SQLSERVERDATASOURCEINFO, the SQL ServerSQL Server Native Client OLE DB provider defines the additional properties; see Data Source Information Properties for more information.

SQL Server Native Client OLE DB 提供者字串The SQL Server Native Client OLE DB Provider String

SQL ServerSQL Server Native Client OLE DB 提供者會識別提供者字串屬性值中類似 ODBC 的語法。The SQL ServerSQL Server Native Client OLE DB provider recognizes an ODBC-like syntax in provider string property values. 建立 OLE DB 資料來源的連接時,提供者字串屬性會當做 OLE DB 初始化屬性 DBPROP_INIT_PROVIDERSTRING 的值提供。The provider string property is provided as the value of the OLE DB initialization property DBPROP_INIT_PROVIDERSTRING when a connection is established to the OLE DB data source. 此屬性會將實作連接所需的 OLE DB 提供者專屬連接資料指定給 OLE DB 資料來源。This property specifies OLE DB provider-specific connection data required to implement a connection to the OLE DB data source. 在字串內,這些元素會使用分號分隔。Within the string, elements are delimited by using a semicolon. 字串中的最終元素必須以分號結束。The final element in the string must be terminated with a semicolon. 每個元素都由一個關鍵字、一個等號字元,以及初始化時傳遞的值所組成。Each element consists of a keyword, an equal sign character, and the value passed on initialization. 例如:For example:

Server=MyServer;UID=MyUserName;  

使用 SQL ServerSQL Server Native Client OLE DB 提供者時,取用者從不需要使用提供者字串屬性。With the SQL ServerSQL Server Native Client OLE DB provider, the consumer never needs to use the provider string property. 取用者可以使用 OLE DB 或 SQL ServerSQL Server Native Client OLE DB 提供者專屬的初始化屬性,設定反映在提供者字串中的任何初始化屬性。The consumer can set any initialization property reflected in the provider string by using either OLE DB or SQL ServerSQL Server Native Client OLE DB provider-specific initialization properties.

如需提供的關鍵字的清單SQL ServerSQL ServerNative Client OLE DB 提供者,請參閱 < 搭配 SQL Server Native Client 使用連接字串關鍵字For a list of the keywords available in the SQL ServerSQL Server Native Client OLE DB provider, see Using Connection String Keywords with SQL Server Native Client.

另請參閱See Also

資料來源物件(OLE DB)Data Source Objects (OLE DB)