#21042 [Opn->Bgs]: Fails to return MS Access MEMO fields

From: Date: Wed, 18 Dec 2002 19:52:09 +0000
Subject: #21042 [Opn->Bgs]: Fails to return MS Access MEMO fields
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27988@lists.php.net to get a copy of this message
ID: 21042 Updated by: kalowsky@php.net Reported By: vinerd@norwich-union.com -Status: Open +Status: Bogus Bug Type: ODBC related Operating System: Windows NT 4.0 PHP Version: 4.3.0RC3 New Comment: please read the options on using odbc_connect() and setting cursors for more information on how to work around this. Technically a MEMO field is not a valid field for ODBC v2, and as such is not supported by PHP. The truth is you can hack around it using the cursor settings in the odbc_connect. Good luck. Not a bug. Previous Comments: ------------------------------------------------------------------------ [2002-12-16 06:10:00] vinerd@norwich-union.com Trying to read MS Access MEMO fields (these are large (>255 chrs) text fields) fails under 4.3.0RC3 in an Eval'd string whereas they work fine under 4.2.3. The error message returned is: Warning: SQL error: [Microsoft][ODBC Microsoft Access 97 Driver]Invalid cursor position; no keyset defined , SQL state S1109 in SQLGetData in c:\InetPub\php\classes\member.php(91) : eval()'d code on line 1 Below is an example of code that causes the problem. The $xFields var is a CSV list of fields in a table. If only the details field is a MEMO type then only this will fail. All other types of field (string or numeric) do not appear to have a problem. The error line will point to the line containing the 'eval' function call. ################CODE################## $xFields = "ref,name,details"; function coreLoad ($cur) { global $xFields; $flds = explode (",", $xFields); for ($i = 0; $i < sizeof ($flds); $i++) { $str = '$this->' . $flds [$i] . ' = odbc_result ($cur, ' . ($i + 1) . ');'; eval ($str); } } ################END OF CODE############## The connection to the MS Access database is through a standard ODBC connection via the Windows Control Panel. No other modules have been compiled into PHP either in 4.2.3 or 4.3.0RC3. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21042&edit=1

« previous php.bugs (#27988) next »