Re: Re: Getting Column Names from an AS400 Database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26-01-2012 16:40, Cheryl Sullivan wrote:

Thanks for your response... I changed the $outval line to

$outval = odbc_columns($rs, "DB#LIBNAME", "%", "TABLENAME", "%");

...but still got the same error -

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


-----Original Message-----
From: Jim Giner [mailto:jim.giner@xxxxxxxxxxxxxxxxxx]
Sent: Thursday, January 26, 2012 10:31 AM
To: php-general@xxxxxxxxxxxxx
Subject:  Re: Getting Column Names from an AS400 Database

I'm thinking that it should read

$rs = $conn->execute($q);
$outval = odbc_columns($rs, "DB#LIBNAME", "%", "TABLENAME", "%");

You need to provide the results of the query to the odbc_columns, not
the
connection object.
Just my guess since I've never used this.

According to the manual, the connection resource should be used.
But anyway, that's not the problem.

The problem is that you're starting with a COM Object, and all of a sudden try to use the odbc functions on it. Of course that blows up in your face, since COM !== ODBC.

Instead, you should use the properties and methods from the COM OLE Object you've instantiated. I don't know what these are exactly, but I'm sure you'll be able to find them in the MSDN reference somewhere.

Just remember that using the COM API will make things a lot harder for you, since you can't rely on the PHP Manual to help you with anything. If you're familair with the OLE object you're using, it shouldn't post any problems though.

- Tul


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux