使用 OdbcConnection 连接到 iSeries:提示密码

发布于 2024-07-11 07:14:53 字数 383 浏览 6 评论 0原文

我想使用 iSeries 客户端访问驱动程序连接到数据库。 我使用以下连接字符串:

DRIVER=客户端访问 ODBC 驱动程序(32 位);QUERYTIMEOUT=0;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;LANGUAGEID=ENU;DFTPKGLIB=QGPL;DBQ= QGPL XXXXXXX;SYSTEM=XXX.XXXXXXX.XXX;Signon=2

连接时出现异常:

错误 [28000] [IBM][iSeries Access ODBC Driver]通信链接失败。 comm rc=8015 - CWBSY1006 - 用户 ID 无效,密码长度 = 0,提示模式 = 从不

如何让应用程序提示用户输入数据库凭据?

I want to connect to DB using the iSeries Client Access driver. I use the following connection string:

DRIVER=Client Access ODBC Driver (32-bit);QUERYTIMEOUT=0;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;LANGUAGEID=ENU;DFTPKGLIB=QGPL;DBQ=QGPL
XXXXXXXX;SYSTEM=XXX.XXXXXXX.XXX;Signon=2

I get an exception when connecting:

ERROR [28000] [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8015 - CWBSY1006 - User ID is invalid, Password length = 0, Prompt Mode = Never

How can I make the application prompt the user for his credentials to the DB?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

西瑶 2024-07-18 07:14:53

根据应用程序的措辞,我认为这是一个桌面应用程序,而不是服务器应用程序。

如果您可以使用 ODBC 数据源管理器中的 ODBC 设置,则可以将其设置为使用 iSeries 访问的默认设置。

否则,您可能必须在应用程序中提示输入用户名和密码,然后将其传递到连接字符串中。

I presume that this is a desktop application and not a server application based on the wording of the application.

If you could make use of the ODBC setup within the ODBC Data Source Administrator, that can be set to use the default setup of iSeries access.

Otherwise, you might have to prompt for the username and password within the application then pass that into the connection string.

转身泪倾城 2024-07-18 07:14:53

下面是如何从 Excel 建立到 iSeries 的 ODBC 连接的快速示例。 如果尚未建立连接,它将提示输入用户名和密码。 您需要在客户端上安装 iSeries Navigator(也称为客户端访问)ODBC 驱动程序。

Dim DB2Con As New ADODB.Connection

DB2Con.Properties("Prompt") = adPromptComplete
DB2Con.Open "DRIVER=Client Access ODBC Driver (32-bit);SIGNON=1;SYSTEM = YOURSYSTEMNAME"

Here's a quick example of how to make an ODBC connection to an iSeries from Excel. It'll prompt for a username and password if it doesn't already have a connection. You'll need the iSeries Navigator (aka client access) ODBC driver installed on the client.

Dim DB2Con As New ADODB.Connection

DB2Con.Properties("Prompt") = adPromptComplete
DB2Con.Open "DRIVER=Client Access ODBC Driver (32-bit);SIGNON=1;SYSTEM = YOURSYSTEMNAME"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文