RE: [PHP] Re: Getting Column Names from an AS400 Database

2012-01-27 Thread Cheryl Sullivan

Indeed!!  Thank you - got it going.  I am by no means a
database-connection expert (clearly)

-Original Message-
From: Maciek Sokolewicz [mailto:tula...@php.net] 
Sent: Thursday, January 26, 2012 11:48 AM
To: php-general@lists.php.net; Cheryl Sullivan
Cc: Jim Giner; php-general@lists.php.net
Subject: Re: [PHP] Re: Getting Column Names from an AS400 Database

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.gi...@albanyhandball.com]
 Sent: Thursday, January 26, 2012 10:31 AM
 To: php-general@lists.php.net
 Subject: [PHP] 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


Notice: This communication, including attachments, may contain information that 
is confidential and protected. It constitutes non-public information intended 
to be conveyed only to the designated recipient(s). If you believe that you 
have received this communication in error, please notify the sender immediately 
by return e-mail and promptly delete this e-mail, including attachments without 
reading or saving them in any manner. The unauthorized use, dissemination, 
distribution, or reproduction of this e-mail, including attachments, is 
prohibited and may be unlawful. Thank you.


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



RE: [PHP] Re: Getting Column Names from an AS400 Database

2012-01-26 Thread Cheryl Sullivan

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.gi...@albanyhandball.com] 
Sent: Thursday, January 26, 2012 10:31 AM
To: php-general@lists.php.net
Subject: [PHP] 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. 



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


Notice: This communication, including attachments, may contain information that 
is confidential and protected. It constitutes non-public information intended 
to be conveyed only to the designated recipient(s). If you believe that you 
have received this communication in error, please notify the sender immediately 
by return e-mail and promptly delete this e-mail, including attachments without 
reading or saving them in any manner. The unauthorized use, dissemination, 
distribution, or reproduction of this e-mail, including attachments, is 
prohibited and may be unlawful. Thank you.


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



Re: [PHP] Re: Getting Column Names from an AS400 Database

2012-01-26 Thread Maciek Sokolewicz

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.gi...@albanyhandball.com]
Sent: Thursday, January 26, 2012 10:31 AM
To: php-general@lists.php.net
Subject: [PHP] 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