Getting Column Names from an AS400 Database

Does anybody know why the following code:

[php]
//----------------------------------------------------
$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”, “%”);
//----------------------------------------------------
[/php]

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.

Sponsor our Newsletter | Privacy Policy | Terms of Service