通过OLEDB连接到ACCDB格式的MS-ACCESS数据库连接到、格式、数据库、ACCESS

2023-09-02 23:46:06 作者:爱上你,是我瞎了眼

我最近做另一个问题有关连接到MS-ACCESS数据库 .NET C#或VB.NET。它的工作就像打算与MDB,但ACCDB就引起了异常

I've recently made another question about connecting to MS-ACCESS database with .NET in C# or VB.NET. It worked just as intended with MDB, but with accdb it caused an exception in

conn.Open();

这如下:

有另一种方式做到这一点?我的初衷(如在原来的问题说明)正在收集一些(实际上,一很多领域)。

Is there another way to do this? My original intention (like stated in the original question) is gathering some (actually, a lot of) fields.

推荐答案

使用ACE 4驱动程序,下载here然后使用下面的连接字符串:

Use ACE 4 driver, download it here then use following connection string:

提供程序= Microsoft.ACE.OLEDB.12.0;数据源= C:\ marcelo.accdb;喷射OLEDB:数据库密码= MyDbPassword;

 
精彩推荐
图片推荐