|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-11 15:56 UTC] chris at grcmc dot org
[2020-09-17 14:01 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2020-09-17 14:01 UTC] cmb@php.net
[2020-09-27 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
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.