×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




I'm trying to connect to iSeries database files using
PHP and the iSeries Access ODBC driver. I have PHP
running on Apache on a W2K machine with a network
connection to an iSeries. 

I have a System DSN defined using the iSeries Access
ODBC Driver 9.00.06.00 where the data source name is
"mysystem".

Here's the php script I created based on the example
from the online PHP manual (where "myusername" is my
iSeries user name, "mypassword" is my iSeries
password, MYLIB is a library name, and MYFILE is a
physical file):

<?php
  //Define the connection to the database.
  $odbc =
odbc_connect("mysystem","myusername","mypassword") or
die("Couldn't define connection");
  //Define the library and file name.
  $libname = "MYLIB";
  $filename = "MYFILE";
  //Get the info.
  $res400 = odbc_columns($conn_ODBC, "mysystem",
$libname, $filename, "%") or die(odbc_errormsg());
  //Display results.
  echo odbc_result_all($res400);
?> 

The script fails on the attempt to assign $res400. 
The message from odbc_errormsg() reads as follows: 

Warning: odbc_columns(): supplied argument is not a
valid ODBC-Link resource in
c:\apacheserver\Apache\htdocs\php\iseries1.php on line
14

Is there anything special I need to do when defining
the DSN?  Would anyone be willing to share a code
example of how to connect to and query an iSeries
database file using PHP running on Apache on a W2K
machine?

Thanks in advance for any help!
Kelly  


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.