php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6645 Solution to 6572
Submitted: 2000-09-09 23:31 UTC Modified: 2000-09-09 23:59 UTC
From: bram at xspace dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.2 OS: WIN NT4.0 Sp6a
Private report: No CVE-ID: None
 [2000-09-09 23:31 UTC] bram at xspace dot com
Bug 6572 claims that MEMO fields cannot be read.

Oddly, this also happens in ASP/vbscript, however you can MEMO fields to work correctly with the following:

You can get MEMO fields to work.  Right now it takes some finesse.

#1) You may try adding $SQL_CUR_USE_ODBC

#2) You need to use odbc_longreadlen before you use odbc_fetch_row, otherwise it will not read enough characters.

#3) As of 4.0.2, making odbc_longread too long may cause PHP to become unstable.

#4) You may need to make a query that only returns the MEMO field to read it correctly.  Otherwise it sometimes just doesn't work (this is similar in ASP and so is probably a bug with Access or ODBC drivers for it.)

Example:

$conn = odbc_connect( $DSN, $user, $pw, $SQL_CUR_USE_ODBC );
$result = odbc_exec( $conn, $query );
odbc_longreadlen( $result, 1000000);

/* Your odbc_fetch_row, etc, will now work */

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-09 23:41 UTC] bram at xspace dot com
That should be SQL_CUR_USE_ODBC without the $.
 [2000-09-09 23:58 UTC] torben@php.net
I've copied this text into the appropriate bug report (#6572).
 [2000-09-09 23:59 UTC] torben@php.net
...and then remembered to close this one...
 [2002-12-18 12:09 UTC] mnewman at dragonorth dot com
See new note on 6572. Fetching the memo field in its own odbc_exec() seems to be sufficient to work around this bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 13:01:31 2024 UTC