最近更新了服务器,操作系统为Windows Server 2008 X64,数据库为SQL Server 2008 X64,但使用存储过程执行OpenDatasource导入Access数据时遇到问题。由于Oledb 4.0已不再支持,出现了如下错误提示:'Microsoft.Jet.OLEDB.4.0'配置为单线程单元模式,无法用于分布式查询;无法创建链接服务器 '(null)'的OLE DB访问接口 'Microsoft.Ace.OLEDB.12.0'实例,同样配置问题。解决方案是安装Office 2010的64位版本,并下载Microsoft Access Database Engine 2010的X64版本,确保两者兼容。修改OpenDatasource参数为Microsoft.ACE.OLEDB.12.0后,问题迎刃而解。以下为修改后的存储过程部分代码: --开启导入功能exec sp_configure 'show advanced options',1 reconfigure exec sp_configure 'Ad Hoc Distributed Queries',1 reconfigure --允许在进程中使用ACE.OLEDB.12 EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1 --允许动态参数EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1 --导入临时表exec ('insert into jihua(id,[批次号],Right('''+ @filepath +''',charindex(''\'',REVERSE('''+ @filepath +'''))))