Author Topic: Getting Column Names from an AS400 Database  (Read 282 times)

chersull_99

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Getting Column Names from an AS400 Database
« on: January 26, 2012, 10:32:58 AM »
Does anybody know why the following code:

PHP Code: [Select]

//----------------------------------------------------
$q sprintf("SELECT * FROM DB#LIBNAME.TABLENAME");
$conn = new COM ("ADODB.Connection")
      or die(
"Cannot start ADO");
$connStr "Provider=IBMDA400;Password=XXXXXX;User ID=XXXX;Data Source=999.99.1.100;Transport Product=Client Access;SSL=DEFAULT"
$conn->open($connStr);
$rs $conn->execute($q);
$outval odbc_columns($conn"DB#LIBNAME""%""TABLENAME""%");
//----------------------------------------------------


results in this error being generated on the $outval line?

odbc_columns() expects parameter 1 to be resource, object given in D:\WAMP\www\directory\filename.php on line 13??

I need to obtain the column names from an AS400 table and I am at a complete loss.