Bug #50151 [Fbk->NoF]: ODBC UPDATE query fails when using certain dates
| From: | php-bugs at lists dot php dot net | Date: | Sun, 27 Sep 2020 04:22:05 +0000 |
| Subject: | Bug #50151 [Fbk->NoF]: ODBC UPDATE query fails when using certain dates | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229230@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50151&edit=1
ID: 50151
Updated by: php-bugs@lists.php.net
Reported by: chris at grcmc dot org
Summary: ODBC UPDATE query fails when using certain dates
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: ODBC related
Operating System: Windows XP SP3
PHP Version: 5.3.0
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2020-09-17 14:01:53] cmb@php.net
I cannot reproduce this with a current PHP 7.4 and the Microsoft
Access Driver (*.mdb, *accdb) version 14.00.7010.1000. Does this
still fail for you with any of the actively supported PHP
versions[1]?
[1] <https://www.php.net/supported-versions.php>
------------------------------------------------------------------------
[2009-11-11 15:56:58] chris at grcmc dot org
I forgot to mention, the "black date" range is from 8/22/2010 to 1/30/2011. Any date
outside this range works, any date within the range fails.
------------------------------------------------------------------------
[2009-11-11 15:53:59] chris at grcmc dot org
Description:
------------
When performing an UPDATE statement using odbc_exec, connected to an Access 97 MDB database, queries
fail when using a date between 8/22/2010 and 1/30/2011. Access database is confirmed to NOT have
any filters or restrictions placed on the field in question, and the same SQL statement properly
executes when entered directly into Access query builder.
When this error occurs, it causes all subsequent UPDATE statements to fail, even if they do not
contain one of the "black dates". SELECT statements placed before and after a failed
query continue to function properly.
Using Apache 2.2.11 (Win32). Original code used the MDB via a network path, but I have isolated the
related code and tested with a local MDB with the same results.
Config line
-------------------
cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi"
"--enable-debug-pack"
"--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared"
"--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"
"--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared"
"--with-enchant=shared"
Reproduce code:
---------------
$cn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)};
DBQ=Access97Database.mdb','','');
// query will work, returns 1/1/2010
$query_obj = odbc_exec($cn, "SELECT ExpireDate FROM tblPerson WHERE ID = 12431");
print_r(odbc_fetch_array($query_obj));
// statement will work
odbc_exec($cn, "UPDATE tblPerson SET ExpireDate = #8/21/2010# WHERE ID = 12431");
print odbc_errormsg();
// query will work, returns 8/21/2010
$query_obj = odbc_exec($cn, "SELECT ExpireDate FROM tblPerson WHERE ID = 12431");
print_r(odbc_fetch_array($query_obj));
// statement will fail with error
odbc_exec($cn, "UPDATE tblPerson SET ExpireDate = #8/22/2010# WHERE ID = 12431");
print odbc_errormsg();
// query will succed, returns 8/21/2010
$query_obj = odbc_exec($cn, "SELECT ExpireDate FROM tblPerson WHERE ID = 12431");
print_r(odbc_fetch_array($query_obj));
// same as first update statement, but will fail with same error as previous
odbc_exec($cn, "UPDATE tblPerson SET ExpireDate = #8/21/2010# WHERE ID = 12431");
print odbc_errormsg();
// query will work, returns 8/21/2010
$query_obj = odbc_exec($cn, "SELECT ExpireDate FROM tblPerson WHERE ID = 12431");
print_r(odbc_fetch_array($query_obj));
Expected result:
----------------
Expected behavior is successful execution of the query. As is demonstrated in the reproduction
code, nothing changes between a query that will work and a query that will fail save the date.
Actual result:
--------------
The actual result is as described in bug report, and the error received is as follows:
-------------------
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver]
Cannot open database '|'. It may not be a database that your application recognizes, or
the file may be corrupt., SQL state S1000 in SQLExecDirect in C:\wamp\www\automation\odbc_bug.php on
line 16
-------------------
Line 16 is the UPDATE statement containing 8/22/2010.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=50151&edit=1