在MFC下使用ODBC读取Excel数据库,之前用着还好好的,突然就用不了了,几经查找发现是Windows安全更新的补丁搞的鬼。
出现错误:
解决方案:
1. 在控制面板——卸载——已安装更新,找到并删除以下安全更新:
| System | Patch Num | Uninstall Command |
|---|---|---|
| Windows 7 、Windows Server 2008 R2 | KB4041681 | wusa /uninstall /kb:4041681 |
| Windows 8 、Windows Server 2012 | KB4041693 | wusa /uninstall /kb:4041693 |
| Windows 10 V1607 、 Windows Server 2016 | KB4041691 | wusa /uninstall /kb:4041691 |
| Windows 10 V1703 | KB4041676 | wusa /uninstall /kb:4041676 |
或者以管理员权限运行cmd,并执行wusa /uninstall命令卸载,然后重启即可。
将连接串
Provider= Microsoft.Jet.OLEDB.4.0 ;Data Source=c:\test.xls;Extended Properties=”Excel 8.0”;
改为
Provider= Microsoft.ACE.OLEDB.12.0 ;Data Source=c:\test.xls;Extended Properties=”Excel 8.0”;
参考:


发布评论