在 ODBC 连接字符串中指定和使用多个库 [英] Specify and use multiple libraries in ODBC connection string

查看:12
本文介绍了在 ODBC 连接字符串中指定和使用多个库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于连接到 DB2i 的 odbc 连接字符串如下所示:

My odbc connection string for connecting to DB2i looks like this:

Driver={Client Access ODBC Driver (32-bit)};system=xx.xx.xx.xx;dbq=LIB1 LIB2 LIB3 LIB4 LIB5 LIB6 LIB7 LIB8;languageid=ENU;qrystglmt=-1;cmt=0;signon=1

上面的连接字符串指定了多个库/模式供使用.但是,当我尝试从第一个库以外的库(如 LIB2...LIB8)访问文件/表时,我收到一个异常提示 "FILE xx not found in LIB1"

The above connection string specifies multiple libraries/schemas for use. But when I try to access a file/table from a library other than the first one (like from LIB2...LIB8) I get a exception saying "FILE xx not found in LIB1"

为什么不自动搜索其他指定库中的文件/表,只搜索第一个库中的文件?

我需要针对这种情况的解决方法.

I need a workaround for this situation.

推荐答案

使用连接字符串.

在您的库列表中,在第一个库之前放置一个逗号.

In your library list, place a comma before the first library.

Driver={Client Access ODBC Driver (32-bit)};system=systemname;naming=1;
dbq=,LIB1,LIB2,LIB3,LIB4,LIB5,LIB6,LIB7,LIB8;languageid=ENU;cmt=0;signon=1

这篇关于在 ODBC 连接字符串中指定和使用多个库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆