|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2018-12-06 23:16 UTC] cmb@php.net
 
-Package: ODBC related
+Package: PDO ODBC
  [2020-09-29 11:59 UTC] cmb@php.net
 
-Status:      Open
+Status:      Feedback
-Assigned To:
+Assigned To: cmb
  [2020-09-29 11:59 UTC] cmb@php.net
  [2020-10-05 15:01 UTC] xxalfa at gmail dot com
  [2020-10-05 15:05 UTC] cmb@php.net
  [2020-10-18 04:22 UTC] php-bugs at lists dot php dot net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 15:00:01 2025 UTC | 
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, '', ''); ?>