I'm running PHP 5.2.4 with ibm_db2 v1.8.0 on Ubuntu 8.04.1 Server. I am trying to hit an IBM iSeries running OS/400 v5R3 but I'm not sure at all how to actually connect without a DSN. I've looked at http://www.connectionstrings.com/ but none of the DB2 or AS/400 connection strings seem to work. All I end up with is:
我在Ubuntu 8.04.1服务器上使用ibm_db2 v1.8.0运行PHP 5.2.4。我正在尝试运行运行OS / 400 v5R3的IBM iSeries,但我不确定如何在没有DSN的情况下实际连接。我查看了http://www.connectionstrings.com/,但DB2或AS / 400连接字符串似乎都不起作用。我最终得到的是:
[IBM][CLI Driver] SQL1013N The database alias name or database name "" could not be found. SQLSTATE=42705 SQLCODE=-1013
Here is my current DSN string:
这是我当前的DSN字符串:
DRIVER={iSeries Access ODBC Driver};SYSTEM=192.168.0.20;Uid=user;Pwd=password
I've also tried the 'IBM DB2 ODBC DRIVER' but get the same error as the string above.
我也尝试了'IBM DB2 ODBC DRIVER'但是得到了与上面的字符串相同的错误。
2 个解决方案
#1
Here is what I use within the .NET environment:
这是我在.NET环境中使用的内容:
Provider=IBMDA400.DataSource.1;Data Source=xxx.xxx.xxx.xxx;Password=xxxxxxxxxx;User ID=xxxxxxxxxx;Initial Catalog=SERVERNAME
You might be missing the "Initial Catalog".
您可能错过了“初始目录”。
#2
As it turns out, I had to use ODBC as there wasn't an easy way to access DBU from PHP without having to set up DB2-C and pipe everything through there.
事实证明,我不得不使用ODBC,因为没有一种简单的方法可以从PHP访问DBU,而无需设置DB2-C并通过那里管理所有内容。
#1
Here is what I use within the .NET environment:
这是我在.NET环境中使用的内容:
Provider=IBMDA400.DataSource.1;Data Source=xxx.xxx.xxx.xxx;Password=xxxxxxxxxx;User ID=xxxxxxxxxx;Initial Catalog=SERVERNAME
You might be missing the "Initial Catalog".
您可能错过了“初始目录”。
#2
As it turns out, I had to use ODBC as there wasn't an easy way to access DBU from PHP without having to set up DB2-C and pipe everything through there.
事实证明,我不得不使用ODBC,因为没有一种简单的方法可以从PHP访问DBU,而无需设置DB2-C并通过那里管理所有内容。