资讯详情

连接字符串格式和属性

连接字符串格式和属性Connection String Format and Attributes

01/19/2017

本文内容

重要

此功能将在 Windows 删除未来版本。This feature will be removed in a future version of Windows. 请避免在新的开发工作中使用该功能,并开始修改仍在使用该功能的应用程序。Avoid using this feature in new development work, and plan to modify applications that currently use this feature. 请改用 Oracle 提供的 ODBC 驱动程序。Instead, use the ODBC driver provided by Oracle.

某些应用程序可能需要指定数据源连接信息的连接字符串,而不是使用对话框。Instead of using a dialog box, some applications might require a connection string that specifies data source connection information. 连接字符串由多个属性组成,它们指定了将驱动程序连接到数据源的方法。The connection string is made up of a number of attributes that specify how a driver connects to a data source. 属性识别了驱动程序在连接到适当的数据源之前需要道的具体信息。An attribute identifies a specific piece of information that the driver needs to know before it can make the appropriate data source connection. 每个驱动程序可能有一组不同的属性,但连接字符串格式始终相同。Each driver might have a different set of attributes, but the connection string format is always the same. 连接字符串具有以下格式:A connection string has the following format:

"DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]"

备注

Microsoft ODBC Driver for Oracle 支持使用 CONNECTSTRING = 连接字符串格式而不是第一个版本的驱动程序 SERVER= 。The Microsoft ODBC Driver for Oracle supports the connection string format of the first version of the driver, which used CONNECTSTRING= instead of SERVER=.

若要连接到支持 Windows 应提供身份验证数据源的程序 Trusted_Connection=yes 指定连接字符串而不是用户 ID 和密码信息。If you are connecting to a data source provider that supports Windows authentication, you should specify Trusted_Connection=yes instead of user ID and password information in the connection string.

如果未指定 UID、PWD、SERVER (或 CONNECTSTRING) 以及驱动程序属性,必须指定数据源名称。You must specify the data source name if you do not specify the UID, PWD, SERVER (or CONNECTSTRING), and DRIVER attributes. 但所有其他属性都是可选的。However, all other attributes are optional. 属性未指定的,默认为属性 " ODBC 数据源管理器 " 对话框的 "相关 DSN" 选项卡中指定的属性。If you do not specify an attribute, that attribute defaults to the one specified in the relevant DSN tab of the ODBC Data Source Administrator dialog box. 属性值可以区分大小写。The attribute value might be case-sensitive.

连接字符串的属性如下:The attributes for the connection string are as follows:

AttributeAttribute

描述Description

默认值Default value

DSNDSN

" ODBC 数据源管理器 " 对话框的 "驱动程序" 选项卡中列出的数据源名称。The data source name listed in the Drivers tab of the ODBC Data Source Administrator dialog box.

""""

PWDPWD

要访问的 Oracle 服务器密码。The password for the Oracle Server that you want to access. 支持此驱动程序 Oracle 限制放置在密码中。This driver supports limitations that Oracle places on passwords.

""""

SERVERSERVER

要访问的 Oracle 连接字符串的服务器。The connect string for the Oracle Server that you want to access.

""""

UIDUID

Oracle 服务器用户名。The Oracle Server user name. 此属性可能不是可选的,具体取决于您的系统,此属性可能会出于安全目的而需要此属性。Depending on your system, this attribute might not be optional - that is, certain databases and tables might require this attribute for security purposes.

使用 "/" 来使用 Oracle 操作系统身份验证。Use "/" to use Oracle's operating system authentication.

""""

BUFFERSIZEBUFFERSIZE

提取列时使用的最佳缓冲区大小。The optimal buffer size used when fetching columns.

从 Oracle 一次提取服务器填充缓冲区。The driver optimizes fetching so that one fetch from the Oracle Server returns enough rows to fill a buffer of this size. 如果提取大量数据,更大的值通常会提高性能。Larger values tend to increase performance if you fetch a lot of data.

6553565535

SYNONYMCOLUMNSSYNONYMCOLUMNS

如果此值为 true (1) ,则 ) API 调用的 SQLColumn ( 返回列信息。When this value is true (1), an SQLColumn( ) API call returns column information. 否则,SQLColumn ( ) 只有表和视图返回列。Otherwise, SQLColumn( ) returns only columns for tables and views. 如果此值没有设置,则用于 Oracle 的 ODBC 驱动程序可以提供更快的访问。The ODBC Driver for Oracle provides faster access when this value is not set.

11

REMARKSREMARKS

如果此值为 true (1) ,驱动程序将返回 SQLColumns 结果集的备注列。When this value is true (1), the driver returns Remarks columns for the SQLColumns result set. 如果此值没有设置,则用于 Oracle 的 ODBC 驱动程序可以提供更快的访问。The ODBC Driver for Oracle provides faster access when this value is not set.

00

StdDayOfWeekStdDayOfWeek

强制执行 DAYOFWEEK 标量的 ODBC 标准。Enforces the ODBC standard for the DAYOFWEEK scalar. 默认情况下,此功能处于打开状态,但需要本地化版本的用户可以将行为更改为使用 Oracle 任何返回的内容。By default this is turned on, but users who need the localized version can change the behavior to use whatever Oracle returns.

11

GuessTheColDefGuessTheColDef

是否应指定驱动程序?SLDescribeCol的cbColDef参数返回非零值。Specifies whether or not the driver should return a non-zero value for the cbColDef argument of SQLDescribeCol. 仅适用于没有 Oracle 定义的刻度的列,例如,计算所得的数值列和定义为数值的列,无精度或小数位数。Applies only to columns where there is no Oracle-defined scale, such as computed numeric columns and columns defined as NUMBER without a precision or scale. 当 Oracle 不提供该信息时, SQLDescribeCol 调用返回130的精度。A SQLDescribeCol call returns 130 for the precision when Oracle does not provide that information.

00

例如,使用 MyOracleServerOracle 服务器和 Oracle 用户 MyUserID 连接到 MyDataSource 数据源的连接字符串应为:For example, a connection string that connects to the MyDataSource data source using the MyOracleServerOracle Server and the Oracle User MyUserID would be:

"DSN={MyDataSource};UID={MyUserID};PWD={MyPassword};SERVER={MyOracleServer}"

使用操作系统身份验证和 MyOtherOracleServerOracle 服务器连接到 MyOtherDataSource 数据源的连接字符串应为:A connection string that connects to the MyOtherDataSource data source using operating system authentication and the MyOtherOracleServerOracle Server would be:

"DSN=MyOtherDataSource;UID=/;PWD=;SERVER=MyOtherOracleServer"

标签: lot连接器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台