Bug #77252 [Com]: PDO ODBC.accdb cannot connect
| From: | xxalfa at gmail dot com | Date: | Mon, 05 Oct 2020 15:01:01 +0000 |
| Subject: | Bug #77252 [Com]: PDO ODBC.accdb cannot connect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229408@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77252&edit=1
ID: 77252
Comment by: xxalfa at gmail dot com
Reported by: xxalfa at gmail dot com
Summary: PDO ODBC.accdb cannot connect
Status: Feedback
Type: Bug
Package: PDO ODBC
Operating System: Windows
PHP Version: 7.3.0
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I tested it again, it works with PHP 7.3.23 x86. But I would like to use x64. When I try to use the
current PHP version 7.4.11 x86 / x64, I get the following error: PHP Warning:
'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown
on line 0
Previous Comments:
------------------------------------------------------------------------
[2020-09-29 11:59:05] cmb@php.net
That works fine for me with current PHP 7.3.
Maybe there is a permission issue in your setup?
------------------------------------------------------------------------
[2018-12-06 16:48:52] xxalfa at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=77252&edit=1