Bug #77252 [NEW]: PDO ODBC.accdb cannot connect

From: Date: Thu, 06 Dec 2018 16:48:52 +0000
Subject: Bug #77252 [NEW]: PDO ODBC.accdb cannot connect
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218294@lists.php.net to get a copy of this message
From: xxalfa at gmail dot com Operating system: Windows PHP version: 7.3.0 Package: ODBC related Bug Type: Bug Bug description:PDO ODBC.accdb cannot connect Description: ------------ Fatal error: Uncaught PDOException: SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] The data source name was not found, and no default driver was specified in C:\test.php:29 C:\test.php(29): PDO->__construct('odbc:Driver={Mi...') With an older PHP version it worked. Test script: --------------- <?php //------------------------------------------------- // HEAD //------------------------------------------------- declare( strict_types = 1 ); error_reporting( -1 ); ini_set( 'html_errors', '0' ); ini_set( 'display_errors', '1' ); define( 'CORE_DIR', dirname( __FILE__ ) . DIRECTORY_SEPARATOR ); header( 'Content-Type:text/plain' ); //------------------------------------------------- // CODE //------------------------------------------------- echo PHP_VERSION . PHP_EOL; extension_loaded( 'pdo_odbc' ) or trigger_error( 'The pdo odbc extension is required.', E_USER_ERROR ); $database_path = CORE_DIR . 'test.accdb'; file_exists( $database_path ) or trigger_error( 'Could not find database file.', E_USER_ERROR ); $database = new PDO( 'odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=' . $database_path ); // $database = new PDO( 'odbc:Driver={Microsoft Access Driver (*.accdb)}; Dbq=' . $database_path . '; Uid=; Pwd=;' ); // $database = odbc_connect( 'Driver={Microsoft Access Driver (*.mdb, *.accdb)}; Dbq=' . $database_path, '', ''); ?> -- Edit bug report at https://bugs.php.net/bug.php?id=77252&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77252&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77252&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77252&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77252&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77252&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77252&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77252&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77252&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77252&r=support Expected behavior: https://bugs.php.net/fix.php?id=77252&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77252&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77252&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77252&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77252&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77252&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77252&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77252&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77252&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77252&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77252&r=mysqlcfg

« previous php.bugs (#218294) next »