管理数据源Managing Data Sources

从驱动程序的安装程序安装的 ODBC 驱动程序后,可以为其定义一个或多个数据源。After you have installed an ODBC driver from the driver's setup program, you can define one or more data sources for it. 数据源名称 (DSN) 应提供的数据; 唯一的说明例如,工资单Accounts PayableThe data source name (DSN) should provide a unique description of the data; for example, Payroll or Accounts Payable. 中列出了对所有当前已安装的驱动程序定义的用户和系统数据源用户 DSN系统 DSN选项卡的ODBC 数据源管理器对话框。The user and system data sources that are defined for all currently installed drivers are listed in the User DSN or System DSN tabs of the ODBC Data Source Administrator dialog box. 中列出了给定目录中的文件数据源文件 DSN选项卡; 要显示的目录中输入查找框中文件 DSN选项卡。The file data sources in a given directory are listed in the File DSN tab; the directory to be shown is entered in the Look in box in the File DSN tab.

备注

若要管理的数据源,连接到在 64 位平台的 32 位驱动程序,请使用 c:\windows\sysWOW64\odbcad32.exe。To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. 若要管理的数据源,连接到 64 位驱动程序,请使用 c:\windows\system32\odbcad32.exe。To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe. 在中管理工具在 64 位 Windows 8 操作系统中,有 32 位和 64 位图标ODBC 数据源管理器对话框。In Administrative Tools on a 64-bit Windows 8 operating system, there are icons for both the 32-bit and 64-bit ODBC Data Source Administrator dialog box.

如果使用 64 位 odbcad32.exe 要配置或删除连接到 32 位驱动程序,例如,一个 DSN驱动程序执行 Microsoft Access (*.mdb) ,将收到以下错误消息:If you use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, for example, Driver do Microsoft Access (*.mdb), you will receive the following error message:

The specified DSN contains an architecture mismatch between the Driver and Application  

若要解决此错误,请使用 32 位 odbcad32.exe 要配置或删除 DSN。To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.

数据源将与你想要通过该驱动程序访问的数据相关联的特定 ODBC 驱动程序。A data source associates a particular ODBC driver with the data you want to access through that driver. 例如,可能会创建要使用的 ODBC dBASE 驱动程序来访问您的硬盘或网络驱动器上的特定目录中找到的一个或多个 dBASE 文件的数据源。For example, you might create a data source to use the ODBC dBASE driver to access one or more dBASE files found in a specific directory on your hard disk or a network drive. 使用 ODBC 数据源管理器,可以添加、 修改和删除数据源,如下表中所述。Using the ODBC Data Source Administrator, you can add, modify, and delete data sources, as described in the following table.

ActionAction 描述Description
添加数据源Adding data sources 它是可以添加多个数据源,每个将驱动程序与你想要使用该驱动程序访问的某些数据相关联。It is possible to add multiple data sources, each one associating a driver with some data you want to access by using that driver. 为每个数据源指定唯一标识该数据源的名称。Give each data source a name that uniquely identifies that data source. 例如,如果创建一组包含客户信息的 dBASE 文件的数据源,您可以命名数据源"Customers。For example, if you create a data source for a set of dBASE files that contain customer information, you might name the data source "Customers." 应用程序通常显示用户从中选择的数据源的名称。Applications typically display data source names for users to choose from.

添加文件数据源是与添加用户或系统数据源略有不同。Adding a file data source is slightly different from adding user or system data sources. 有关详细信息,请参阅 ODBC 数据源管理器帮助文件。For more information, see the ODBC Data Source Administrator help file.
修改数据源Modifying data sources 具体取决于您的需求,你可能会发现不必重新配置数据源。Depending on your requirements, you might find it necessary to reconfigure data sources. 可以通过单击选项重置配置任何驱动程序安装程序对话框中。You can reset options by clicking Configure in any driver setup dialog box.
删除数据源Deleting data sources 单击删除后选择数据源。Click Remove after selecting a data source.

有关文件的数据源的详细信息,请参阅连接使用的文件数据源SQLDriverConnect 函数For more information about file data sources, see Connecting Using File Data Sources or the SQLDriverConnect Function.

请参阅See Also

ODBC 数据源管理器ODBC Data Source Administrator