Ask a Question related to PHP Bugs, Design and Development.
-
johnc at inkjetinc dot com #1
#38458 [Com]: Fails to get values of fields following a MEMO type field in MS Access
ID: 38458
Comment by: johnc at inkjetinc dot com
Reported By: costas at meezon dot com
Status: Assigned
Bug Type: PDO related
Operating System: Windows XP Prof
PHP Version: 5.1.4
Assigned To: wez
New Comment:
I am seeing the same problem accessing MEMO fields in Visual FoxPro
using pdo/odbc in php 5.1.6. I was previusly using php 5.1.1 and did
not encounter this issue in that version (in php 5.1.1 I addeded pdo
maually from the pecl compiled sources).
Previous Comments:
------------------------------------------------------------------------
[2006-08-16 14:48:48] costas at meezon dot com
I have teste with snapshot as suggested and get the exact same results
(version PHP Version 5.2.0RC2-dev)
Results:
doe|mm||nn2||
smith|xx||yy2||
doe|mm||nn2||
smith|xx||yy2||
doe|mm|120 main street|nn2|10006|
smith|xx|320 bway|yy2|10007|
------------------------------------------------------------------------
[2006-08-15 06:41:12] [email]tony2001@php.net[/email]
Please try using this CVS snapshot:
[url]http://snaps.php.net/php5.2-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php5.2-win32-latest.zip[/url]
------------------------------------------------------------------------
[2006-08-15 00:11:36] costas at meezon dot com
Description:
------------
I have an MS Access database and use PDO/ODBC. There are 2 MEMO type
columns (notes and notes2) in one table 'tblNotes'.
tblNotes structure
-------------------
LastName - text,
notes - memo,
addr - text,
notes2 - memo
zip - text
I added 2 rows and manually populated all the columns with data. The
notes and notes2 have just a couple of characters each.
Problem:
---------
When I use 'SELECT * from tblNotes' all rows are retrieved, but the
values for all non-MEMO type columns (which follow MEMO columns) are
null. This means addr and zip are NULL but LastName is correct.
If I explicitly name the columns in the SELECT I get the same result
(E.g. SELECT LastName, notes, addr, notes2, zip from tblNotes order by
LastName). This means addr and zip are NULL but LastName is correct.
Workaround:
------------
If I move the notes and notes2 columns to the end, then all the values
are retrieved (E.g. SELECT LastName, addr, zip, notes, notes2 from
tblNotes order by LastName)
This is OK if you have just a few columns. Otherwise you have to type
them all in.
I am not sure if this is a PDO problem or ODBC.
Reproduce code:
---------------
<?php
$tbl='tblNotes';
$user='';
$pass='';
$conn = "DSN=mailing;Driver=Microsoft Access Driver";
try {
$dbh = new PDO("odbc:$conn", $user, $pass);
$cursor=$dbh->query("SELECT * from $tbl order by LastName");
foreach ($cursor as $row) {
$row=array_change_key_case($row, CASE_UPPER);
echo $row['LASTNAME'] . '|';
echo $row['NOTES'] . '|';
echo $row['ADDR'] . '|';
echo $row['NOTES2'] . '|';
echo $row['ZIP'] . '|';
echo "\n";
}
echo "\n";
$cursor1=$dbh->query("SELECT LastName, notes, addr, notes2, zip
from $tbl order by LastName");
foreach ($cursor1 as $row) {
$row=array_change_key_case($row, CASE_UPPER);
echo $row['LASTNAME'] . '|';
echo $row['NOTES'] . '|';
echo $row['ADDR'] . '|';
echo $row['NOTES2'] . '|';
echo $row['ZIP'] . '|';
echo "\n";
}
echo "\n";
$cursor2=$dbh->query("SELECT LastName, addr, zip, notes, notes2
from $tbl order by LastName");
foreach ($cursor2 as $row) {
$row=array_change_key_case($row, CASE_UPPER);
echo $row['LASTNAME'] . '|';
echo $row['NOTES'] . '|';
echo $row['ADDR'] . '|';
echo $row['NOTES2'] . '|';
echo $row['ZIP'] . '|';
echo "\n";
}
} catch (PDOException $e) {
echo $e->getMessage();
}
$dbh = null;
?>
Expected result:
----------------
For $cursor -- wrong result
doe|mm||nn||
smith|xx||yy||
For $cursor1 -- wrong result
doe|mm||nn||
smith|xx||yy||
For $cursor2 --- Correct result
doe|mm|120 main street|nn|10006|
smith|xx|320 bway|yy|10007|
Actual result:
--------------
See expected results above.
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=38458&edit=1[/url]
johnc at inkjetinc dot com Guest
-
#38458 [Asn->Csd]: Fails to get values of fields following a MEMO type field in MS Access
ID: 38458 Updated by: wez@php.net Reported By: costas at meezon dot com -Status: Assigned +Status: ... -
updating access memo fields
How can one use Flash to update an Access Memo field and retain the whitespace a user inputs? See Paul Gubbay's Time Entry Application: Sample... -
Memo Field with Access
Hopefully someone can help me with this. I have a memo field in Access, I type for example into the text box on the webpage: (ignore the >) *... -
Exception error querying Access database from ASP page... Memo field type?
Hi! Working with an MS Access database from an ASP webpage and I'm getting an Exception error... Error Type: (0x80020009) Exception... -
Memo fields in MS Access
Is there anyone that really uses DB2 8.1 memo fields in MS Access? I'm experiencing a lot of problems with them. I tried both using LONG VARCHAR...



Reply With Quote

