How can my 64bit application access OLEDB?
“Microsoft.ACE.OLEDB.12.0”,也就是说,Microsoft Access数据库引擎2010可再发行可从here下载。还有一个64位版本。
可以找到“Microsoft.ACE.OLEDB.12.0”提供程序的连接字符串here。
How can I list the available providers on the system?
使用OleDbEnumerator.GetRootEnumerator:
using System;
using System.Data;
using System.Data.OleDb;
class Program
{
static void Main()
{
OleDbDataReader reader = OleDbEnumerator.GetRootEnumerator();
DisplayData(reader);
Console.WriteLine("Press any key to continue.");
Console.ReadKey();
}
static void DisplayData(OleDbDataReader reader)
{
while (reader.Read())
{
for (int i = 0; i < reader.FieldCount; i++)
{
Console.WriteLine("{0} = {1}",
reader.GetName(i), reader.GetValue(i));
}
Console.WriteLine("==================================");
}
}
}
来源
2012-06-20 21:06:54
kol
这是使用Visual Studio的?如果是这样,您可以将目标CPU从64位更改为32. http://msdn.microsoft.com/en-us/library/ff407621.aspx – Thousand
构建不使用VS,应用程序需要保留64位。 – Justin808