Home Database Mysql Tutorial 64位系统使用Access 数据库文件的彻底解决方法

64位系统使用Access 数据库文件的彻底解决方法

Jun 07, 2016 pm 03:37 PM
64 bit access use database document system

最近,有PDF.NET用户问我怎么在64位 系统 下无法访问Access 数据库 的问题,我第一反应是我怎么没有遇到呢?今天一看自己的VS和Office都是32位版本的,所以在VS里面调试访问Access是没有问题的,但是直接 使用 编译好的.NET程序访问Access,就出问题了,报:

    最近,有PDF.NET用户问我怎么在64位系统下无法访问Access数据库的问题,我第一反应是我怎么没有遇到呢?今天一看自己的VS和Office都是32位版本的,所以在VS里面调试访问Access是没有问题的,但是直接使用编译好的.NET程序访问Access,就出问题了,报:

    未在本地计算机上注册“Microsoft.Jet.Oledb.4.0”提供程序。

    于是,又在公司的电脑上(Win7 64位)做了实验,发现跟家里面的Win8.1 64位 问题一样,上网搜索了一下,大部分都建议将.NET程序编译的时候,目标平台设定为 x86 ,我试了下,果然成功。

    但是,如果你的.NET程序是别人编译好的,且在64位系统上运行,要访问Access数据库,怎么办呢?

    首先想到,看能否通过应用程序配置文件,将.NET程序配置成运行在 32位 系统下,找了很久资料,无果,放弃。

    再想想,是不是跟自己的Office是32位有关呢?

    关键问题不在于是Access 2010还是Access 2013而已,不必钻牛角尖,何不求其次,安装一个Access 2007/2010的Database Engine不就行了。

 

解决办法:

①   下载安装Microsoft Access Database Engine 2010 Redistributable(28MB),共有32bit(下载)和64bit(下载)两个版本,具体要安装哪个要看你的Office程序是32bit的还是64bit的,比如:我的PC是64bit的Win8 Pro,但是我Office的程序是32bit的,所以我应当安装AccessDatabaseEngine.exe(32bit);

②   打开你的.NET应用程序配置文件(应用程序名.config,Web应用程序为 Web.config),设置数据库连接字符串的Provide Microsoft.ACE.OLEDB.12.0,例如标准连接字符串为:"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Data.accdb;Persist Security Info=False;"

再次运行程序,OK,数据库连接成功,一切正常。

注意:64位系统下一定要修改提供程序为 Microsoft.ACE.OLEDB.12.0,而此时的文件名,可以是 早期的 mdb文件,也可以是新的 accdb 文件

        如果你虽然是64位系统,但是你的Office 是32位的,所以你只能安装32位的ACE驱动,因此你的.NET应用程序也只能发布成32位的,如果编译成anycpu版本,还是无法访问ACE。

        (PS:如果你发布成x86格式的目标平台,并且不想使用accdb格式的Access数据库文件,那么就不必安装上面的32位ACE驱动了,省得折腾:-《)

 

此问题受影响的 PDF.NET 开发框架相关程序:

1,SimpleAccessWinForm 程序,下载地址 ,64位系统使用Access 数据库文件的彻底解决方法     PDF.Net_V4.6 WinForm 数据表单实例    

example,            526K, uploaded             Mar 27, 2013             -            809 downloads

运行该程序后,请修改 SimpleAccessWinForm.config 文件的内容,如果是第一次运行,程序会自动创建该文件自动创建数据库文件文件内容比如:

<span></span><span>xml version="1.0" encoding="utf-8"</span><span>?></span>
<span><span>configuration</span><span>></span>
    <span><span>connectionStrings</span><span>></span>
        <span><span>add </span><span>name</span><span>="AccessConn"</span><span> connectionString</span><span>="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TEST.mdb"</span><span>
            providerName</span><span>="Access"</span> <span>/></span>
    <span></span><span>connectionStrings</span><span>></span>
<span></span><span>configuration</span><span>></span></span></span></span>
Copy after login

2,PDF.NET集成开发工具,下载地址:64位系统使用Access 数据库文件的彻底解决方法     安装程序    

application,            1576K, uploaded             May 25, 2011             -            1943 downloads

下载后,请找到运行目录下的 子目录 Config ,然后打开配置文件 DataConnectionCfg.xml ,找到相关的配置节:

 

<span></span><span>xml version="1.0" encoding="utf-8" </span><span>?></span>
<span><span>DataConnections</span><span>></span>
    <span><span>Group </span><span>Name</span><span>="默认分组"</span><span>></span>
        <span><span>Connection </span><span>DbType</span><span>="SQLServer"</span><span> Name</span><span>="default"</span><span> ConnectionString</span><span>="Data Source=.;Integrated Security=True"</span> <span>/></span>
        <span><span>Connection </span><span>DbType</span><span>="SQLServer"</span><span> Name</span><span>=".\SQLEXPRESS"</span><span> ConnectionString</span><span>="Data Source=.\SQLEXPRESS;Integrated Security=True"</span> <span>/></span>
        <span><span>Connection </span><span>DbType</span><span>="SQLServerCe"</span><span> Name</span><span>="SQLCE"</span><span> ConnectionString</span><span>="Data Source=E:\DAC\LocalDB.sdf;Password=sasa;Persist Security Info=True"</span> <span>/></span>
    <span></span><span>Group</span><span>></span>
    <span><span>Group </span><span>Name</span><span>="XX二期"</span><span>></span>
        <span><span>Connection </span><span>DbType</span><span>="SQLite"</span><span> Name</span><span>="SQLite"</span><span> ConnectionString</span><span>="Data Source=E:\jjzd.db"</span><span> Provider</span><span>="PWMIS.DataProvider.Data.SQLite,DataAccess"</span><span>/></span>
        <span><span>Connection </span><span>DbType</span><span>="SQLServer"</span><span> Name</span><span>="192.168.50.1"</span><span> ConnectionString</span><span>="server=192.168.50.5;uid=sa;pwd=sasa"</span><span> Provider</span><span>=""</span><span>/></span>
    <span></span><span>Group</span><span>></span>
    <span><span>Group </span><span>Name</span><span>="分组2"</span><span>></span>
        <span><span>Connection </span><span>DbType</span><span>="Access"</span><span> Name</span><span>="default"</span><span> ConnectionString</span><span>="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=TEST.mdb"</span><span> Provider</span><span>="Access"</span><span>/></span>
        <span><span>Connection </span><span>DbType</span><span>="SQLServer"</span><span> Name</span><span>="50.25"</span><span> ConnectionString</span><span>="server=192.168.50.25;uid=sa;pwd=sasa"</span><span> Provider</span><span>=""</span><span>/></span>
     
    <span></span><span>Group</span><span>></span>
<span></span><span>DataConnections</span><span>></span></span></span></span></span></span></span></span></span></span></span></span>
Copy after login

经过这样的配置以后,就可以直接打开集成开发工具了,如下图:
64位系统使用Access 数据库文件的彻底解决方法

 

总结:

64位系统下.NET访问Access 数据库彻底方法是安装64位的Access数据访问驱动安装程序 并使用新的Access提供程序  Microsoft.ACE.OLEDB.12.0

 

 

 

 

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to disable background applications in Windows 11_Windows 11 tutorial to disable background applications How to disable background applications in Windows 11_Windows 11 tutorial to disable background applications May 07, 2024 pm 04:20 PM

1. Open settings in Windows 11. You can use Win+I shortcut or any other method. 2. Go to the Apps section and click Apps & Features. 3. Find the application you want to prevent from running in the background. Click the three-dot button and select Advanced Options. 4. Find the [Background Application Permissions] section and select the desired value. By default, Windows 11 sets power optimization mode. It allows Windows to manage how applications work in the background. For example, once you enable battery saver mode to preserve battery, the system will automatically close all apps. 5. Select [Never] to prevent the application from running in the background. Please note that if you notice that the program is not sending you notifications, failing to update data, etc., you can

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

How to convert deepseek pdf How to convert deepseek pdf Feb 19, 2025 pm 05:24 PM

DeepSeek cannot convert files directly to PDF. Depending on the file type, you can use different methods: Common documents (Word, Excel, PowerPoint): Use Microsoft Office, LibreOffice and other software to export as PDF. Image: Save as PDF using image viewer or image processing software. Web pages: Use the browser's "Print into PDF" function or the dedicated web page to PDF tool. Uncommon formats: Find the right converter and convert it to PDF. It is crucial to choose the right tools and develop a plan based on the actual situation.

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Jun 02, 2024 pm 02:58 PM

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

How to read dbf file in oracle How to read dbf file in oracle May 10, 2024 am 01:27 AM

Oracle can read dbf files through the following steps: create an external table and reference the dbf file; query the external table to retrieve data; import the data into the Oracle table.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Huawei will launch the Xuanji sensing system in the field of smart wearables, which can assess the user's emotional state based on heart rate Huawei will launch the Xuanji sensing system in the field of smart wearables, which can assess the user's emotional state based on heart rate Aug 29, 2024 pm 03:30 PM

Recently, Huawei announced that it will launch a new smart wearable product equipped with Xuanji sensing system in September, which is expected to be Huawei's latest smart watch. This new product will integrate advanced emotional health monitoring functions. The Xuanji Perception System provides users with a comprehensive health assessment with its six characteristics - accuracy, comprehensiveness, speed, flexibility, openness and scalability. The system uses a super-sensing module and optimizes the multi-channel optical path architecture technology, which greatly improves the monitoring accuracy of basic indicators such as heart rate, blood oxygen and respiration rate. In addition, the Xuanji Sensing System has also expanded the research on emotional states based on heart rate data. It is not limited to physiological indicators, but can also evaluate the user's emotional state and stress level. It supports the monitoring of more than 60 sports health indicators, covering cardiovascular, respiratory, neurological, endocrine,

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

See all articles