I get the following output from a very simple page which tries to
connect to a db2 database hosted on my linux system, which is also
hosting my apache/php system. I have tried several permutations of the
connect string:
"animals"
"odbc://localhost/animals"
"dbc:/user@keyword/localhost/animals"
all with the same result. the php page is appended after the error
message. The book is singularly uninformative about this message and its
possible causes in this environment. If you have any ideas or pointers
to further information, I would greatly appreciate it.
---------------message/screen shot--------------------------------------
animals
Warning: odbc_connect(): SQL error: [IBM][CLI Driver] CLI0126E Operation
invalid at this time. SQLSTATE=S1011, SQL state S1011 in
SQLSetConnectOption in /var/www/html/test/second.php on line 15
fail
---------------php code-------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
<html>
<head>
<title>First Database Try</title>
</head>
<body bgcolor="#ffffff">
<h1>
<?php
putenv("DB2INSTANCE=db2inst1");
// $cs = "odbc:/uu:pw/localhost/animals";
$cs = "animals";
echo "$cs";
// $res = odbc_connect($cs,"uu","pw");
$res =
odbc_connect($cs,"uu","pw",SQL_CUR_USE_ODBC);
if ( $res===False) {
echo "fail";
}
else {
echo "succeed";
}
?>
</h1>
</body>
</html>
~