The 64-bit system uses the Access database file to completely solve the problem.

Source: Internet
Author: User
Tags microsoft access database

The 64-bit system uses the Access database file to completely solve the problem.

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:

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, what if your. NET program is compiled by someone else and runs on a 64-bit system to Access the Access database?

First of all, check whether the. NET program can be configured to run in a 32-bit system through the application configuration file. after a long time of searching for information, you can 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.

 

Solution:

① 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 program is 32bit or 64bit. For example, if my PC is 64bit Win8 pro, but my development program is 32bit, I should install accessdatabaseengine.exe (32bit );

② Open your.. NET application configuration file (Application name. config. The Web application is Web. config), set the Provide Microsoft. ACE. OLEDB.12.0, 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, the database connection is successful, and everything is normal.

Note: In a 64-bit system, you must change the provider to Microsoft. ACE. OLEDB.12.0. The file name can be an early mdb file or a new accdb file.

 

Affected PDF. NET development framework programs:

1. SimpleAccessWinForm program, example, 526 K, uploaded Mar 27,201 3-809 downloads

After running the program, modify the content of the SimpleAccessWinForm. config file. If this is the first time the program runs, the program automatically creates the file andAutomatically create database files, File content such:

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

2. PDF. NET integrated development tool,: application, 1576 K, uploaded May 25,201 1-1943 downloads download, find the sub-directory Config under the running directory, and open the configuration file DataConnectionCfg. xml, find the relevant configuration section:

<? Xml version = "1.0" encoding = "UTF-8"?> <DataConnections> <Group Name = "default Group"> <Connection DbType = "SQLServer" Name = "default" ConnectionString = "Data Source = .; integrated Security = True "/> <Connection DbType =" SQLServer "Name = ". \ SQLEXPRESS "ConnectionString =" Data Source =. \ SQLEXPRESS; Integrated Security = True "/> <Connection DbType =" SQLServerCe "Name =" SQLCE "ConnectionString =" Data Source = E: \ DAC \ LocalDB. sdf; Password = sasa; persist Security Info = True "/> </Group> <Group Name =" XX Phase II "> <Connection DbType =" SQLite "Name =" SQLite "ConnectionString =" Data Source = E: \ jjzd. db "Provider =" PWMIS. dataProvider. data. SQLite, DataAccess "/> <Connection DbType =" SQLServer "Name =" 192.168.50.1 "ConnectionString =" server = 192.168.50.5; uid = sa; pwd = sasa "Provider =" "/> </Group> <Group Name =" Group 2 "> <Connection DbType =" Access "Name =" default "ConnectionString =" Provider = microsoft. ACE. OLEDB.12.0; Data Source = TEST. mdb "Provider =" Access "/> <Connection DbType =" SQLServer "Name =" 50.25 "ConnectionString =" server = 192.168.50.25; uid = sa; pwd = sasa "Provider =" "/> </Group> </DataConnections>

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

 

Summary:

The most thorough Method for. NET Access to the Access database in a 64-bit system is to install the 64-bit Access Data Access Driver Installer and use the new Access provider Microsoft. ACE. OLEDB.12.0

 

 

 


How to run an access database in a 64-bit System

The program may not be correctly installed. /Connect to "website content management" database. asp, line 2: IIS runs in 64-Bit mode. It can only load 64-bit modules, but not 32-bit modules. However, the jet engine accessing the access database only has 32 bits and no 64 bits, so it cannot be loaded by IIS. Solution: run IIS in 32-Bit mode, so that the 32-bit jet engine can be called. Solution: Enter cscript C: \ inetpub \ adminscripts \ adsutil in the command line window. vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1 negative effect of the above method: because IIS is changed to a 32-bit running mode, it can only load 32-bit modules. If another 64-bit module is loaded in IIS before modification, the module cannot be loaded after modification. If you want to continue using the functions of this module, you can only find the 32-bit version of this module and load it.

64-bit win7 Access database connection problem (c # Program)

64-bit win7 supports 32-bit programs. The reason you write is that the data filling table in the Access database fails to be called, not the database connection failure. I suspect that your Access database file is messy. You try to regenerate one MDB file in a 64-bit system and check if there is any problem. If no data is imported

Related Article

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.