Peter. It is not a bug in OpenLink's driver but in PHP - odbc_connect is setting a cursor by default when you connect. This is usually fine, but a cursor needs a primary key. If no primary key exists, there will be a problem. This of course will always be a problem with views, as running a cursor against a view makes very little sense. There is a workaround to prevent odbc_connect from automatically selecting a cursor type when connecting - edit php_odbc.h and comment out: #define HAVE_SQL_EXTENDED_FETCH 1 and recompile your php/apache setup. Hope this helps! Best regards, Andrew -------------------------------------- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com > -----Original Message----- > From: WC Ip [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 11:22 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Can PHP read View in stead of Table? > > > > > Dear all, > > I have install PHP on Linux and use Openlink ODBC Driver to link to MS SQL > server on Windows NT. Just now I can read data from Table on SQL server. > However, when I make View on the same database, I can't use PHP > to extract data > from this View. When I do query on the View, error message shown: > > Warning: SQL error: [OpenLink][ODBC][Driver]No key columns found for table > referenced > by keyset driven cursor., SQL state IM909 in SQLExecDirect in > /usr/local/apache_1.3.12/htdocs/internet.php on line 42 > > The possible problem may due to primary key of table. As testing, > I found the > table > with primary i can access easily. However, when i remove primary > key from the > same > table, error has shown and cannot show data. > > May I solve this problem or this is the bugs of openlink ODBC driver? > > Thanks for your help!!! > > Peter > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]