#29583 [Fbk->Opn]: com_dotnet crashes when trying to strlen
| From: | edwin at rabbito dot org | Date: | Tue, 10 Aug 2004 01:22:21 +0000 |
| Subject: | #29583 [Fbk->Opn]: com_dotnet crashes when trying to strlen | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64339@lists.php.net to get a copy of this message | ||
ID: 29583
User updated by: edwin at rabbito dot org
Reported By: edwin at rabbito dot org
-Status: Feedback
+Status: Open
Bug Type: COM related
Operating System: Windows
PHP Version: 5CVS-2004-08-09 (dev)
New Comment:
There is no output from the CLI, apart from the Dr. Watson exception
dialog:
An application error has occurred and an application error log is being
generated.
php.exe
Exception: access violation (0xc0000005), Address: 0x1008a9de.
Previous Comments:
------------------------------------------------------------------------
[2004-08-09 12:44:38] wez@php.net
Crash or exception?
Paste the output you see from the CLI here please.
------------------------------------------------------------------------
[2004-08-09 11:54:27] edwin at rabbito dot org
Description:
------------
When trying to retrieve a date field from an Access 97 database, the
actual data returned is different from PHP4 (PHP 4 returns a timestamp,
whereas PHP 5 returns a date, ie) 02/04/04 instead of a timestamp). By
calling the code (as attached) in PHP5, PHP does not return error
gracefully, but crashes.
(seems to be something that is not yet fixed in bug#29392)
Reproduce code:
---------------
$security="C:\access97.mdw";
$user="access";
$password="access";
$dsn="Driver={Microsoft Access Driver (*.mdb)};
DBQ=$database;SystemDB=$security;Uid=$user;Pwd=$password";
$db = new COM("ADODB.Connection");
$db->open($dsn);
$query="SELECT DateField1 FROM [Table1];";
$rs = $db->execute($query);
if (!$rs->EOF()) {
echo strlen($rs->Fields(0)->Value);
}
Expected result:
----------------
Either an error should be returned due to invalid type
($rs->Fields(0)->Value in date type), or the actual length the the date
string.
Actual result:
--------------
PHP crashed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29583&edit=1