软件安装程序报错 Provider=Microsoft.ACE.OLEDB.12.0

ganendexin1987 2012-03-28 08:25:44
我遍写了一个小程序。 用的是 access 数据库 配置文件如下
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="connstr" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Database\Lottery.accdb;Persist Security Info=True"
providerName="System.Data.OleDb" />

</connectionStrings>
<appSettings>
<add key="DB" value="access"/>
</appSettings>
</configuration>


然后我制作成安装程序给我朋友测试。 他安装完以后 出现了 未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序 如下的详细错误

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.InvalidOperationException: 未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序。
在 System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
在 System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
在 System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
在 System.Data.OleDb.OleDbConnection.Open()
在 cheshiDAL.Access.Dal.GetAllLottery() 位置 G:\正式发布\cheshi\cheshiDAL\Access\DAL.cs:行号 26
在 cheshiBLL.BizLottery.GetAllLottery() 位置 G:\正式发布\cheshi\cheshiBLL\BizLottery.cs:行号 27
在 cheshi.Form1.GetNPeriod() 位置 G:\张连凯软件专用\数据程序\cheshi\cheshi\Form1.cs:行号 38
在 cheshi.Form1.Form1_Load(Object sender, EventArgs e) 位置 G:\张连凯软件专用\数据程序\cheshi\cheshi\Form1.cs:行号 23
在 System.Windows.Forms.Form.OnLoad(EventArgs e)
在 System.Windows.Forms.Form.OnCreateControl()
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WmShowWindow(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** 已加载的程序集 **************
mscorlib
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1891 (QFEN-1.050727-1800)
基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework2.0.50727/mscorlib.dll
----------------------------------------
cheshi
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///D:/Program%20Files/我的程序eshi.exe
----------------------------------------
System.Windows.Forms
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1891 (QFEN-1.050727-1800)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400)
基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
cheshiBLL
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///D:/Program%20Files/我的程序eshiBLL.DLL
----------------------------------------
cheshiFactory
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///D:/Program%20Files/我的程序eshiFactory.DLL
----------------------------------------
cheshiIDAL
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///D:/Program%20Files/我的程序eshiIDAL.DLL

请问 高手 这个怎么解决呀?
...全文
1565 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Redeom 2013-10-12
  • 打赏
  • 举报
回复
http://www.connectionstrings.com/ace-oledb-12-0/
pig pig vs 2013-10-12
  • 打赏
  • 举报
回复
用标准代码就行了。
_小黑_ 2013-10-12
  • 打赏
  • 举报
回复
你在 安装的时候需要检查 用户的电脑上 是否安装 了 使用 软件 的 环境,可以把 运行软件的环境 打包进去 之后 在安装
杨友山 2012-03-29
  • 打赏
  • 举报
回复
没有access引擎。
这个是64位的引擎
32位的自己找吧。安装包时把exe打进去就行了,安装时自动运行安装引擎。
kiba518 2012-03-29
  • 打赏
  • 举报
回复
那是配置环境的问题 跟安装装包无关
ganendexin1987 2012-03-29
  • 打赏
  • 举报
回复
如何在我制作安装包的时候解决这个问题呀?
孟子E章 2012-03-28
  • 打赏
  • 举报
回复
使用Provider=Microsoft.ACE.OLEDB.12.0;之前,你需要安装这个
http://www.microsoft.com/downloads/zh-cn/details.aspx?familyid=c06b8369-60dd-4b64-a44b-84b371ede16d

另外,这个分64位版本和32位版本,要分清楚

111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧