Getting Column Names from an AS400 Database
| From: | Cheryl Sullivan | Date: | Thu, 26 Jan 2012 15:06:27 +0000 |
| Subject: | Getting Column Names from an AS400 Database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-316398@lists.php.net to get a copy of this message | ||
Can someone tell me why the following code:
//----------------------------------------------------
$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
Cheryl L. Sullivan
Interface Analyst / Web Developer
Sacred Heart Hospital (www.shh.org <http://www.shh.org/> )
421 Chew Street * Allentown, PA 18102
Office: 610-776-4784
Sacred Heart Hospital - 2011 Greater Lehigh Valley Chamber of Commerce
Business of the Year <http://www.shh.org/news/release.asp?id=145>
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.