This topic is locked
[SOLVED]

 DB2 on AS400... How to connect?

8/31/2011 11:46:44 AM
PHPRunner General questions
J
Jkelleyus author

I love using PHPR, and have for for many years, but I'm running into some roadblocks these days with new projects.
Our setup for this project is as follows:
Program : PHPR 5.3 (or 6.0)

Data Source : IBM iSeries AS400 running V5R4

Web Server : IBM AS400 (local to database) Zend for I
I cannot seem to get a connection going to the AS/400 in the PHPR environment without using ODBC, but when I use ODBC the project will not function after being published to the AS/400. I have tried differing connection strings in multiple variations but have had no luck.
This seems like it should be a simple task, as I've used CodeCharge Studio against the same environment and it works well. I'd prefer to use PHPR.
Can anyone offer any hints on how to make this work?
Thanks,
John

Admin 8/31/2011

John,
could you clarify what sort of errors you getting after publishing?
Also, what kind of connection string CodeCharge generates that works for you? I guess you can use the same connection settings with PHPRunner.

J
Jkelleyus author 9/1/2011



John,
could you clarify what sort of errors you getting after publishing?
Also, what kind of connection string CodeCharge generates that works for you? I guess you can use the same connection settings with PHPRunner.


The connection string I am using (that works in CodeCharge) is like this:
Provider=IBMDADB2.DB2COPY1;Password=xxxxxxx;Persist Security Info=True;User ID=xxxxxxx;Data Source=S10XX7B;Location="";Extended Properties=""
If I use this exact string in PHPR I get a 'Dispatch Error #3127, [AS] SQL0204N "SYSCAT.TABLES" is an undefined name. SQL State 42704. This occurs in PHPR itself (not when published).
When published (if I use the ODBC connection, which will work in PHPR) I get connection errors. This makes sense as OS/400 doesn't operate in the same manner as Windows, ODBC wise.
Codecharge has an added option that allows the developer to tell it what OS the app is targeted for. I believe if we could get the IBMDADB2 provider to work, all would be OK. I think PHPR's problem is that it's targeting a Windows-based OS instead of OS/400 (the clue is the SYSCAT.TABLES, which doesn't exist on an AS/400. The correct table name is likely QSYS2.TABLES.
Any help you can offer will be greatly appreciated. I'd like to try out the mobile theme specifically for this project, so perhaps we can work together to solve the problem?
Thanks,
John

Admin 9/1/2011

Here is what you can try.

  1. Connect to your database using ODBC (or whatever method works).
  2. Than on 'Output directory' screen create a new server connection and specify connection string that you want to see on your server.
    Let me know if this helps.

J
Jkelleyus author 9/1/2011



Here is what you can try.

  1. Connect to your database using ODBC (or whatever method works).
  2. Then on 'Output directory' screen create a new server connection and specify connection string that you want to see on your server.
    Let me know if this helps.


Using your suggestion, I first tried this in PHPR 5.3 and got this error after publishing:
Fatal error: Call to undefined function odbc_connect() in /www/zendsvr/htdocs/test/include/dbconnection.php on line 9
If I try the same in PHPR 6.0 I get this instead:
Fatal error: Class 'COM' not found in /www/zendsvr/htdocs/test/include/dbconnection.ado.php on line 12
Hmmmm... what else should we try?
Thanks,
John

Admin 9/1/2011

John,
I would ask you to contact support directly at http://support.xlinesoft.com. We need to see some files in order to find a workaround.