1

I'm trying to connect my WEB server to AS400. The web server has not DB2 library neither ODBC library.

I have installed XAMPP in my Windows computer, and one of my colleagues also did. He has Client Access on his Computer.

We both installed: - XAMPP - ibm_data_server_driver_package_win32_v10.5.exe

We tried to install PECL DB2 extension (LINK) but unsuccessfully (got error ".\php.exe appears to have a suffix .exe, but config variable php": seems that nobody has solved this problem on Windows...).

Then we saw that XAMPP has the ODBC Module already on it, so we tried to estabilish a connection with obdc_connect. Referring to THIS question we are now able to connect to AS400 using his computer with Client Access Drivers using:

$user = 'USER';
$password = 'PASS';
$hostname = '192.168.1.30';
$server="Driver={Client Access ODBC Driver (32-bit)};
         System=$hostname;
         Uid=$user;
         Pwd=$password;";

odbc_connect($server, $user, $password);

With my computer I tried to use the IBM data server driver already installed using:

$user = 'USER';
$password = 'PASS';
$hostname = '192.168.1.30';
$server="Driver={IBM DB2 ODBC DRIVER};
         System=$hostname;
         Uid=$user;
         Pwd=$password;";

odbc_connect($server, $user, $password);

and I get always this error:

Warning: odbc_connect(): in C:\xampp\htdocs\test.php on line 11

When I've tried with IBM DB2 ODBC DRIVER on my colleague's computer, I've also got the same error.

What is this error? No information is specified. We would like to use db2_connect instead of odbc_connect. What should we do to install this extension? I asked my ISP to install the db2 extension on the WEB server but I'm still waiting... maybe he also encountered some problems (the WEB server is a UNIX machine).

Any help is much apprecciated!

Floern
  • 33,559
  • 24
  • 104
  • 119
Perocat
  • 1,481
  • 7
  • 25
  • 48
  • 1
    You cannot use the standard IBM DB2 ODBC driver to connect to an iSeries (AS/400) server, not directly anyway. You either use Client Access (iSeries Access) driver, or install a DB2 Connect gateway, which will let you use the IBM DB2 ODBC driver. – mustaccio Jun 06 '14 at 17:55
  • If I install the IBM DB2 ODBC driver on my WEB server, where and how should I setup a DB2 Connect gateway? On another Windows Server? – Perocat Jun 06 '14 at 18:49
  • It might be on the same server or on another, does not matter, as long as it can connect to the database server. Keep in mind that DB2 Connect is not free. – mustaccio Jun 06 '14 at 19:25
  • I saw (`http://www-03.ibm.com/software/products/en/db2-connect-family`)... is it possible to use a Windows Server with Client Access as pass-through point? I connect with WEB Server to this server and then this will connect to the AS400 sys. I cannot install Client Access on the WEB Server cause we have an external ISP... – Perocat Jun 06 '14 at 19:41
  • ...this license has to be installed on the AS400 or on the server with the driver? I suppose on the AS400... The solution could be install the Client Access driver on the WEB server and use them with ODBC to connect to the AS400, right? Thank you very much! – Perocat Jun 06 '14 at 19:48
  • If you **can** install Client Access on the web server that would be the easiest solution. If you **cannot**, DB2 Connect can be installed anywhere (it's not just a license, it's a special DB2 instance) -- not on the AS/400 system though, the DB2 ODBC driver should be installed on the web server. It will connect (locally or remotely) to the DB2 Connect instance, which will relay data to AS/400 and back. – mustaccio Jun 06 '14 at 20:04
  • Thank you again! So if DB2 connect is installed on one of our server, this server would be the Connect gateway? Cause I read here (http://www-03.ibm.com/software/products/en/db2-connect-family) that the Connect gateway is no longer necessary. So I thought I could install the license on the AS/400 – Perocat Jun 06 '14 at 22:18
  • 2
    The point is that the DB2 ODBC driver does not understand the communication protocol used by the AS/400, so you either need the driver that does (Client Access) or the gateway that translates between the two protocols (DB2 Connect). – mustaccio Jun 07 '14 at 13:50

0 Answers0