A thorough solution for 64-bit systems to use Access database files

Source: Internet
Author: User
Tags microsoft access database
Recently, a PDF. NET user asked me how I could not Access the Access database in a 64-bit system. Why didn't I encounter the first problem? Today, we can see that our VS and Office versions are both 32-bit, so there is no problem in debugging Access in VS, but we can directly use the compiled version. NET program Access to Access, there is a problem, report:

Recently, a PDF. NET user asked me how I could not Access the Access database in a 64-bit system. Why didn't I encounter the first problem? Today, we can see that our VS and Office versions are both 32-bit, so there is no problem in debugging Access in VS, but we can directly use the compiled version. NET program Access to Access, there is a problem, report:

Recently, a PDF. NET user asked me howSystemCannot AccessDatabaseMy first response was: Why didn't I encounter it? Today, we can see that our VS and Office versions are both 32-bit, so there is no problem in debugging Access in VS, but it is directUseIf the compiled. NET program accesses Access, the following error occurs:

The Microsoft. Jet. Oledb.4.0 provider is not registered on the local computer.

As a result, I did an experiment on the company's computer (Win7 64-bit) and found that the problem was the same as that of Win8.1 64-bit in my family. I searched the internet and most of them recommended that I. when the NET program was compiled, the target platform was set to x86. I tried it and it was successful.

However, if your. NET program is compiled by someone else andSystemTo AccessDatabaseWhat should I do?

First, check whether the application can be configured.File, Configure the. NET program to run in 32-bitSystemNext, I found the materials for a long time, no result, give up.

Think about it, isn't it related to your Office being 32-bit?

The key issue is not the Access 2010 or Access 2013. You don't have to be an expert. Why not install an Access 2007/2010 Database Engine.

SolutionMethod:

① Download and install Microsoft Access Database Engine 2010 Redistributable (28 MB). There are two versions: 32bit (download) and 64bit (download, the specific installation depends on whether your Office program is 32bit or 64bit. For example, if my PC is 64bit Win8 pro, but my officeprogram is 32bit, I should install accessdatabaseengine.exe (32bit );

② Open your. NET application configurationFile(Application name. config, Web application is Web. config), setDatabaseProvide Microsoft. ACE. OLEDB.12.0 of the connection string. For example, the standard connection string is: "Provider = Microsoft. ACE. OLEDB.12.0; Data Source = Data. accdb; Persist Security Info = False ;"

Run the program again. OK,DatabaseThe connection is successful and everything is normal.

Note: 64-bitSystemYou must change the provider to Microsoft. ACE. OLEDB.12.0.FileIt can be an early mdbFileOr a new accdb.File.

If you are a 64-bitSystemBut your Office is 32-bit, so you can only install 32-bit ACE driver, so your.. NET applications can only be published to 32-bit versions. If the application is compiled to the anycpu version, ACE cannot be accessed.

(PS: if you publish a target platform in x86 format and do not wantUseAccess in accdb formatDatabaseFileSo you don't have to install the 32-bit ACE driver :-《)

Affected PDF. NET development framework programs:

1. SimpleAccessWinForm program, PDF. Net_V4.6 WinForm data form instance

Example, 526 K, uploaded Mar 27,201 3-809 downloads

After running this program, modify SimpleAccessWinForm. configFileThe program automatically createsFileAndAutomatic CreationDatabaseFile,FileFor example:

 
     
          
       
  
 

2. PDF. NET Integrated Development Tool: Installer

Application, 1576 K, uploaded May 25,201 1-1943 downloads

After downloading, find the sub-directory Config in the running directory and open the configurationFileDataConnectionCfg. xml:

 
     
          
           
           
       
      
          
           
       
      
          
           
            
  
 

After such configuration, you can directly open the integrated development tool, such:

Summary:

64-bitSystemAccess under. NETDatabase, MostThoroughOfMethodIs to install the 64-bit Access Data Access Driver Installer andUseThe new Access provider Microsoft. ACE. OLEDB.12.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.