select * --into barcode
from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'Excel 5.0 ;
HDR=YES;Data Source==E:\D当前工作\201104\管理系统\没有条码的目录.xls',
sheet1$)Msg 7399, Level 16, State 1, Line 2
OLE DB 提供程序 'MICROSOFT.JET.OLEDB.4.0' 报错。 

解决方案 »

  1.   

    改成Excel 2007也或Excel 2003也不行啊,我的是2007的
      

  2.   

    这样也不行的
    select * --into useinfo 
    from OPENROWSET('MICROSOFT.JET.OLEDB.4.0' ,'MICROSOFT Excel 97-2005 ;
    HDR=YES;Data Source==E:\D当前工作\201104\管理系统\没有条码的目录.xls',
    sheet1$)
      

  3.   

    我碰到过这种情况,我通过以下方法解决的看看适合你不在Sql Server中查询一下Excel文件的时候出现问题:
    SELECT * FROM OPENROWSET( 'MICROSOFT.JET.OLEDB.4.0','Excel 
    8.0;IMEX=1;HDR=YES;DATABASE=F:\AAA.xls',[sheet1$])
        结果提示:
        SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad HocDistributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。
    查询相关资料,找到解决方法:
        启用Ad Hoc Distributed Queries:
    exec sp_configure 'show advanced options',1
    reconfigure
    exec sp_configure 'Ad Hoc Distributed Queries',1
    reconfigure
        使用完成后,关闭Ad Hoc Distributed Queries:
    exec sp_configure 'Ad Hoc Distributed Queries',0
    reconfigure
    exec sp_configure 'show advanced options',0
    reconfigure 
      

  4.   

    --EXCEL2003SELECT *  into useinfo  FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=E:\D当前工作\201104\管理系统\没有条码的目录.xls', [sheet1$])--excel2007
      select  * into useinfo  
    FROM OPENROWSET (
      'Microsoft.ACE.OLEDB.12.0' ,
      'Excel 12.0;Database=E:\D当前工作\201104\管理系统\没有条码的目录.xlsx;HDR=YES' ,
      'SELECT * FROM [sheet1$]' )
      

  5.   

    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 79
    配置选项 'Ad Hoc Distributed Queries' 不存在,也可能是高级选项。
     
    有效的配置选项为:
      

  6.   

    我用的2007上的2003文件
    5L的报这个错:
    [OLE/DB provider returned message: 找不到可安装的 ISAM。]
    OLE DB 错误跟踪[OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005:   ]。
    Msg 7399, Level 16, State 1, Line 1
    OLE DB 提供程序 'Microsoft.Jet.OLEDB.4.0' 报错。
    用2007打开:
    OLE DB 错误跟踪[Non-interface error:  Provider not registered.]。
    Msg 7403, Level 16, State 1, Line 1
    未能找到 OLE DB 提供程序 'Microsoft.ACE.OLEDB.12.0' 的注册表项。
      

  7.   

    OLE DB 提供程序 'MICROSOFT.ACE.OLEDB.12.0' 报错
    为什么?