简体   繁体   English

php 64位SQL状态IM002中的MS Access DB错误

[英]MS Access DB in php 64bit SQL state IM002 error

I'm trying to fetch data from access db in php. 我正在尝试从php中的Access数据库获取数据。 Code works fine for 32 bit php( I've tested in php version>5), but code generates error for 64bit php wamp. 代码对于32位php正常工作(我已经在php版本> 5中进行了测试),但是代码为64位php wamp生成了错误。

Error Message: Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in 错误消息: Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in

What I've tried : How can I correct this error: Data source name not found and no default driver specified 我尝试过的方法: 如何纠正此错误:找不到数据源名称,也未指定默认驱动程序

Code : 代码:

$connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$db", "","");
$tabs = odbc_tables($connection);

Is there any solution or I've to install 32 bit version? 有什么解决方案,或者我必须安装32位版本?

Microsoft Access Driver (*.mdb)

refers to the older Access "Jet" driver which is installed as part of Windows itself but is only available to 32-bit applications. 是指较旧的Access“ Jet”驱动程序,该驱动程序作为Windows本身的一部分安装,但仅对32位应用程序可用。 (There is no 64-bit version of Jet.) (没有64位版本的Jet。)

You could download and install the 64-bit version of the newer Access Database Engine (aka "ACE", available here ) and then use 您可以下载并安装更新版本的Access数据库引擎的64位版本(又名“ ACE”,可在此处获得 ),然后使用

Microsoft Access Driver (*.mdb, *.accdb)

as the driver name. 作为驱动程序名称。 (Assuming that the WAMP server does not already have a copy of Access 2007 or later installed on it.) (假设WAMP服务器尚未安装Access 2007或更高版本的副本。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM