初始化和授权属性Initialization and Authorization Properties

适用对象:是SQL Server 是Azure SQL 数据库 是Azure Synapse Analytics (SQL DW) 是并行数据仓库 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) yesParallel Data Warehouse

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口将 OLE DB 初始化和授权属性解释如下:The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider interprets OLE DB initialization and authorization properties as follows: |属性 IDProperty ID|说明Description| |-----------------|-----------------| |DBPROP_AUTH_CACHE_AUTHINFODBPROP_AUTH_CACHE_AUTHINFO| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口不缓存身份验证信息。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider does not cache authentication information.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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|[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 提供程序使用标准[!INCLUDE[msCoName](../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]的安全机制来隐藏密码。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider uses standard [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] security mechanisms to conceal passwords.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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 值,则 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口使用 Windows 身份验证模式来授权用户访问由 DBPROP_INIT_DATASOURCE 和 DBPROP_INIT_CATALOG 属性指定的 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 数据库。If DBPROP_AUTH_INTEGRATED is set to a NULL pointer, a null string, or 'SSPI' VT_BSTR value, the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider uses Windows Authentication Mode to authorize user access to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database specified by the DBPROP_INIT_DATASOURCE and DBPROP_INIT_CATALOG properties.

如果它设置为 VT_EMPTY(默认值),则使用 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 安全机制。If it is set to VT_EMPTY (the default), [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] security is used. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 登录和密码是在 DBPROP_AUTH_USERID 和 DBPROP_AUTH_PASSWORD 属性中指定的。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login and password are specified in the DBPROP_AUTH_USERID and DBPROP_AUTH_PASSWORD properties.| |DBPROP_AUTH_MASK_PASSWORDDBPROP_AUTH_MASK_PASSWORD| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口使用标准的 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 安全机制来隐藏密码。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider uses standard [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] security mechanisms to conceal passwords.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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|分配给 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 登录名的密码。Password assigned to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login. 选用 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 身份验证来授权访问 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 数据库时,将使用该属性。This property is used when [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Authentication is selected for authorizing access to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database.| |DBPROP_AUTH_PERSIST_ENCRYPTEDDBPROP_AUTH_PERSIST_ENCRYPTED|保存身份验证信息时,[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口不加密这些信息。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider does not encrypt authentication information when persisted.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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|如果需要,[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口保存包括密码的图像在内的身份验证值。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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|[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]id.login. 选用 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 身份验证来授权访问 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 数据库时,将使用该属性。This property is used when [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Authentication is selected for authorizing access to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database.| |DBPROP_INIT_ASYNCHDBPROP_INIT_ASYNCH| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口支持异步启动。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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. 有关详细信息,请参阅[执行异步操作](../../relational-databases/native-client/features/performing-asynchronous-operations.md)。For more information, see [Performing Asynchronous Operations](../../relational-databases/native-client/features/performing-asynchronous-operations.md).| |DBPROP_INIT_CATALOGDBPROP_INIT_CATALOG|要连接的现有 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 数据库的名称。Name of an existing [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database to which to connect.| |DBPROP_INIT_DATASOURCEDBPROP_INIT_DATASOURCE|运行 [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例的服务器的网络名称。Network name of a server running an instance of [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. 如果计算机上有多个[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]正在运行的实例,则为了连接到值的特定实例[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] ,DBPROP_INIT_DATASOURCE 指定为\* \\\ServerName\InstanceName\*。If there are multiple instances of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] running on the computer, in order to connect to a specific instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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 是只读的;如果尝试设置它,将返回 dwstatus 错误 DBPROPSTATUS_NOTSETTABLE\*\*。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| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口不支持模拟级别调整。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider does not support impersonation level adjustment.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口将验证区域设置 ID,如果区域设置 ID 不受支持或未安装在客户端上,它会返回错误。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口支持数据源初始化的所有提示模式。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider supports all prompting modes for data source initialization. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口使用 DBPROMPT_NOPROMPT 作为此属性的默认设置。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider uses DBPROMPT_NOPROMPT as its default setting for the property.| |DBPROP_INIT_PROTECTION_LEVELDBPROP_INIT_PROTECTION_LEVEL| [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口不支持在与 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例的连接上使用保护级别。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider does not support a protection level on connections to instances of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在尝试设置属性值时返回 DB_S_ERRORSOCCURRED。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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|请参阅本主题后面部分中的 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口字符串。See the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider string later in this topic.| |DBPROP_INIT_TIMEOUTDBPROP_INIT_TIMEOUT|如果无法在指定的秒数内建立与 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例的连接,则 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口将在初始化时返回错误。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider returns an error on initialization if a connection to the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] cannot be established within the number of seconds specified.| 在特定于访问接口的属性集中 DBPROPSET_SQLSERVERDBINIT, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 提供程序定义了这些附加的初始化属性。In the provider-specific property set DBPROPSET_SQLSERVERDBINIT, the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider defines these additional initialization properties. |属性 IDProperty 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. 有关详细信息,请参阅[以编程方式更改密码](../../relational-databases/native-client/features/changing-passwords-programmatically.md)。For more information, see [Changing Passwords Programmatically](../../relational-databases/native-client/features/changing-passwords-programmatically.md).| |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:[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口通过进行 Unicode 转换来转换在客户端和服务器之间发送的 ANSI 字符串,从而最大程度地减少匹配客户端和服务器上的代码页之间的扩展字符方面的问题:VARIANT_TRUE: The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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:

对于发送到 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]char、varchar 或 text 变量、参数或列实例的客户端 DBTYPE_STR 数据,它们先使用客户端 ANSI 代码页 (ACP) 从字符转换到 Unicode,再使用服务器的 ACP 从 Unicode 转换到字符\*\*\*\*\*\*\*\*\*\*\*\*。Client DBTYPE_STR data sent to an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]**char**, **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.

[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]使用服务器 ACP 将发送到客户端 DBTYPE_STR 变量的**char**、 **varchar**或**text**数据从字符转换为 UNICODE,然后使用客户端 ACP 将 unicode 转换为字符。**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.

这些转换由 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口在客户端上执行。These conversions are performed on the client by the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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:

发送到服务器上的 char、varchar 或 text 的 Unicode DBTYPE_WSTR 客户端数据\*\*\*\*\*\*\*\*\*\*\*\*。Unicode DBTYPE_WSTR client data sent to **char**, **varchar**, or **text** on the server.

发送到客户端上的 Unicode DBTYPE_WSTR 变量的**char**、 **varchar**或**text**服务器数据。**char**, **varchar**, or **text** server data sent to a Unicode DBTYPE_WSTR variable on the client.

发送到服务器上的 Unicode nchar、nvarchar 或 ntext 的 ANSI DBTYPE_STR 客户端数据\*\*\*\*\*\*\*\*\*\*\*\*。ANSI DBTYPE_STR client data sent to Unicode **nchar**, **nvarchar**, or **ntext** on the server.

发送到客户端上的 ANSI DBTYPE_STR 变量的 Unicode char、varchar 或 text 服务器数据\*\*\*\*\*\*\*\*\*\*\*\*。Unicode **char**, **varchar**, or **text** server data sent to an ANSI DBTYPE_STR variable on the client.

VARIANT_FALSE:[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口不执行字符转换。VARIANT_FALSE: The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider does not perform character translations.

Native Client OLE DB 提供程序不会转换发送到服务器上的**char**、 **varchar**或 text 变量、参数或列的客户端 ANSI 字符 DBTYPE_STR 的数据。 \*\*\*\* [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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 变量的 char、varchar 或 text 数据,不执行转换\*\*\*\*\*\*\*\*\*\*\*\*。No translation is performed on **char**, **varchar**, or **text** data sent from the server to DBTYPE_STR variables on the client.

如果客户端和 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例正在使用不同的 ACP,可能会错误地解释扩展字符。If the client and the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] are using different ACPs, extended characters can be misinterpreted.| |SSPROP_INIT_CURRENTLANGUAGESSPROP_INIT_CURRENTLANGUAGE|类型:VT_BSTRType: VT_BSTR

R/W:读/写R/W: Read/write

说明:[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 语言名称。Description: A [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] language name. 标识用于系统消息选择和格式化的语言。Identifies the language used for system message selection and formatting. 必须在运行 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例的计算机上安装该语言,否则数据源初始化将失败。The language must be installed on the computer running an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] or data source initialization fails.| |SSPROP_INIT_DATATYPECOMPATIBILITYSSPROP_INIT_DATATYPECOMPATIBILITY|类型:VT_UI2Type: VT_UI2

R/W:读/写R/W: Read/write

默认值:0Default: 0

说明:在 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 和 ActiveX 数据对象 (ADO) 应用程序之间实现数据类型兼容。Description: Enables data type compatibility between [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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,则数据类型处理仅使用 [!INCLUDE[ssVersion2000](../../includes/ssversion2000-md.md)] 数据类型。If the value of 80 is used, data type handling uses only [!INCLUDE[ssVersion2000](../../includes/ssversion2000-md.md)] data types. 有关详细信息,请参阅将[ADO 用于 SQL Server Native Client](../../relational-databases/native-client/applications/using-ado-with-sql-server-native-client.md)。For more information, see [Using ADO with SQL Server Native Client](../../relational-databases/native-client/applications/using-ado-with-sql-server-native-client.md).| |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. 有关详细信息,请参阅[使用数据库镜像](../../relational-databases/native-client/features/using-database-mirroring.md)。For more information, see [Using Database Mirroring](../../relational-databases/native-client/features/using-database-mirroring.md).| |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. 如果数据库是以前附加的,则 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 不重新附加它。If the database was previously attached, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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. 有关详细信息,请参阅[使用多个活动的结果集 (MARS)](../../relational-databases/native-client/features/using-multiple-active-result-sets-mars.md)。For more information, see [Using Multiple Active Result Sets (MARS)](../../relational-databases/native-client/features/using-multiple-active-result-sets-mars.md).| |SSPROP_INIT_NETWORKADDRESSSSPROP_INIT_NETWORKADDRESS|类型:VT_BSTRType: VT_BSTR

R/W:读/写R/W: Read/write

说明:运行由 DBPROP_INIT_DATASOURCE 属性指定的 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例的服务器的网络地址。Description: The network address of the server running an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] specified by the DBPROP_INIT_DATASOURCE property.| |SSPROP_INIT_NETWORKLIBRARYSSPROP_INIT_NETWORKLIBRARY|类型:VT_BSTRType: VT_BSTR

R/W:读/写R/W: Read/write

说明:用于与 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 实例通信的网络库 (DLL) 的名称。Description: The name of the networklibrary (DLL) used to communicate with an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. 该名称不应当包含路径或 .dll 文件扩展名。The name should not include the path or the .dll file name extension.

可以使用 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 客户端配置实用工具来自定义其默认值。The default can be customized using the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Client Configuration Utility.

注意:该属性仅支持 TCP 和 Named Pipes。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. 默认的 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口网络数据包大小是 4,096。The default [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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.

有关详细信息,请参阅[使用加密但不验证](../../relational-databases/native-client/features/using-encryption-without-validation.md)。For more information, see [Using Encryption Without Validation](../../relational-databases/native-client/features/using-encryption-without-validation.md).| |SSPROP_INIT_USEPROCFORPREPSSPROP_INIT_USEPROCFORPREP|类型:VT_I4Type: VT_I4

R/W:读/写R/W: Read/write

默认值:SSPROPVAL_USEPROCFORPREP_ONDefault: SSPROPVAL_USEPROCFORPREP_ON

说明:[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 存储过程的使用情况。Description: The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] stored procedure use. 定义 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 临时存储过程的使用,以支持 ICommandPrepare 接口\*\*\*\*。Defines the use of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 提供程序定义了其他属性;有关详细信息,请参阅[数据源信息属性](../../relational-databases/native-client-ole-db-data-source-objects/data-source-information-properties.md)。In the provider-specific property set DBPROPSET_SQLSERVERDATASOURCEINFO, the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider defines the additional properties; see [Data Source Information Properties](../../relational-databases/native-client-ole-db-data-source-objects/data-source-information-properties.md) for more information. ## SQL Server Native Client OLE DB 访问接口字符串The SQL Server Native Client OLE DB Provider String [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口可以识别访问接口字符串属性值中类似 ODBC 的语法。The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 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; ``` 使用 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口,使用者永远都不需要使用访问接口字符串属性。With the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider, the consumer never needs to use the provider string property. 通过使用 OLE DB 或特定于 [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 访问接口的初始化属性,使用者可以设置在访问接口字符串中反映的任何初始化属性。The consumer can set any initialization property reflected in the provider string by using either OLE DB or [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider-specific initialization properties. 有关[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB 提供程序中可用的关键字列表,请参阅将[连接字符串关键字用于 SQL Server Native Client](../../relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client.md)。For a list of the keywords available in the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB provider, see [Using Connection String Keywords with SQL Server Native Client](../../relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client.md). ## 另请参阅See Also [数据源对象 (OLE DB)Data Source Objects (OLE DB)](../../relational-databases/native-client-ole-db-data-source-objects/data-source-objects-ole-db.md)