无法识别的数据库格式accdbb [英] Unrecognized database format accdbb
问题描述
我正在尝试将c#windows窗体连接到Access数据库,在尝试添加新数据源时,我看到一条错误消息:"无法识别的数据库格式..."
当我在数据源配置向导中打开高级选项时,我看到tis连接字符串:"Provider = Microsoft。 Jet.OLEDB.4.0;数据源=" C:\Users\MyPC \Documents\Access Databases \sample_database.accdb"
我正在使用Office 365(MS Access是此订阅的一部分),Visual Studio Community 2015,.Net Framework 4.5或4.6。
< p style ="">这里有Microsoft.ACE.OLEDB版本的问题,应该使用哪一个?我不确定这个版本在我的情况下是否已经过时:Microsoft Access数据库引擎2010可再发行版
或其他问题。
非常感谢!
The p style ="" Jet OLEDB Provider无法打开.accdb文件。是的,您确实需要使用ACE OLEDB提供程序:
VB:
Dim accessConnection As New System.Data.OleDb .OleDbConnection(" Provider = Microsoft.ACE.OLEDB.12.0;& _
" Data Source = C:\ Users\MyPC\Documents\Access Databases \sample_database.accdb" )C#
System.Data.OleDb.OleDbConnection accessConnection = new System.Data.OleDb.OleDbConnection( " Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C:\\Users\\MyPC\\Documents\\Access Databases \\sample_database.accdb");如果未安装ACE OLEDB Provider,则需要下载:
https://www.microsoft.com/en-us/download/details.aspx?id=13255
确保为您的应用程序(或Microsoft Office)安装正确的版本。 Microsoft通常建议使用32位版本。 Visual Studio项目的平台应设置为x86(32位)。
I'm trying to connect c# windows form to Access database and when trying to add a new data source I see an error message saying: "Unrecognized database format..."
When I open Advanced options in Data Source Configuration Wizard I see tis connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\Users\MyPC\Documents\Access Databases\sample_database.accdb"
I'm using Office 365 (MS Access is a part of this subscription), Visual Studio Community 2015, .Net Framework 4.5 or 4.6.
Is the problem with Microsoft.ACE.OLEDB version here and which one should be used? I'm not sure if this version is obsolete in my case: Microsoft Access Database Engine 2010 Redistributable
Or something else is an issue.
Many thanks!
The Jet OLEDB Provider cannot open a .accdb file. Yes, you do need to use the ACE OLEDB Provider:
VB:
Dim accessConnection As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:\Users\MyPC\Documents\Access Databases\sample_database.accdb")C#
System.Data.OleDb.OleDbConnection accessConnection = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\MyPC\\Documents\\Access Databases\\sample_database.accdb");If the ACE OLEDB Provider is not installed then you will need to download:
https://www.microsoft.com/en-us/download/details.aspx?id=13255
Make sure to install the correct version for your app (or Microsoft Office). Microsoft generally recommends using the 32-bit version. The Platform for your Visual Studio project should be set to x86 (32-bit).
这篇关于无法识别的数据库格式accdbb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!