OLE DB provider 'Microsoft.Jet.OLEDB.4.0' does not contain table 'GRW0511$'. The table either does not exist or the current user does not have permissions on that table. OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName='Microsoft.Jet.OLEDB.4.0', TableName='GRW0511$']. 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: OLE DB provider 'Microsoft.Jet.OLEDB.4.0' does not contain table 'GRW0511$'. The table either does not exist or the current user does not have permissions on that table. OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName='Microsoft.Jet.OLEDB.4.0', TableName='GRW0511$'].源错误: 
行 186:   sqls = "INSERT OPENDATASOURCE ('sqloledb','Data Source=161.92.143.8;User ID=gavin;Password=123456' ).VRAS.dbo.W0601 (Vendor,Purchasing,Trans,Material_Doc,Item,Posting_da,Quantity,Price,Amount,Curre,Reference,Document,Reference_Doc,Material,Plant,Week) SELECT * FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','Data Source=p;User ID=Admin;Password=;Extended properties=Excel 5.0')...[GRW0511$]" 
行 187:   dim cmd as SqlCommand = new SqlCommand(sqls,Conn)
行 188:  cmd.ExecuteNonQuery()
行 189:  DataGrid1.visible = false
行 190:   LABEL1.TEXT = "successful!"
PS:  1、EXCEL文件中肯定包含GRW0511这个sheet
     2、我是以系统管理员登陆的,对EXCEL肯定有操作权限我就是搞不明白,错误提示为什么会说找不到EXCEL中的那个sheet的 -_-!  大家谁遇到过这种情况么?该怎么去解决呢?

解决方案 »

  1.   

    1、确保Conn已打开。
    2、虽然你以管理员登陆的,但如果是2000的系统,还是要设置,文件或文件夹的权限的,让Everyone能完全控制.
    你试试看行不行.
      

  2.   

    谢谢楼上的几位兄弟了一、我确保conn.open
    二、我放EXCEL的文件夹已经设置为EveryOne完全控制
    三、确实存在GRW0511这sheet上面的错误我都能排除掉,可是我就是无法正常运行~~~~
      

  3.   


    你如果是2000的系统,那你就要将asp.net的用户加到管理员的组中。试试  在用户管理里
      

  4.   

    还是没有用 -_-!
    那我能不能把
    INSERT OPENDATASOURCE ('sqloledb','Data Source=161.92.143.8;User ID=gavin;Password=123456' ).VRAS.dbo.W0601 (Vendor,Purchasing,Trans,Material_Doc,Item,Posting_da,Quantity,Price,Amount,Curre,Reference,Document,Reference_Doc,Material,Plant,Week) SELECT * FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','Data Source=p;User ID=Admin;Password=;Extended properties=Excel 5.0')...[GRW0511$]
    这段代码当成一个SQL脚本来执行呢?具体怎么样才能用VB.NET来操作呢?而且怎么获得那些EXCEL的名称呢(变量)?
      

  5.   

    http://www.cnblogs.com/renyu732/archive/2005/06/15/174866.html
      

  6.   

    上面的兄弟说的几个好象都是关于DataGrid和EXCEL,我现在要的是SQL和EXCEL的啊
      

  7.   

    我把权限也确认过了,装了.net framework1.1, EXCEL的表也是没问题的,可是就是运行出现上面的错误,把INSERT OPENDATASOURCE ('sqloledb','Data Source=161.92.143.8;User ID=gavin;Password=123456' ).VRAS.dbo.W0601 (Vendor,Purchasing,Trans,Material_Doc,Item,Posting_da,Quantity,Price,Amount,Curre,Reference,Document,Reference_Doc,Material,Plant,Week) SELECT * FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0','Data Source=p;User ID=Admin;Password=;Extended properties=Excel 5.0')...[GRW0511$]放到SQL的查询分析器里运行,结果SQL出错,说无法提供出错信息,我郁闷~~~