从EXCEL导入数据的错误 OLE DB ?

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

根据msdn的语句  
   
                  dim   ds   as   system.data.dataset  
                  dim   mycommand   as   system.data.oledb.oledbdataadapter  
                  dim   myconnection   as   system.data.oledb.oledbconnection  
   
                  myconnection   =   new   system.data.oledb.oledbconnection(   _  
                              "provider=microsoft.jet.oledb.4.0;   "   &   _  
                              "data   source=d:\temp\temp.xls;   "   &   _  
                              "extended   properties=excel   8.0;")  
                    select   the   data   from   sheet1   of   the   workbook.  
                  mycommand   =   new   system.data.oledb.oledbdataadapter(   _  
                              "select   *   from   [temp]",   myconnection)  
   
                  ds   =   new   system.data.dataset  
                  mycommand.fill(ds)                   ****执行到这一句话时,出错。  
                  myconnection.close()  
   
  出错信息:  
    .net   数据   ole   db   提供程序(system.data.oledb)要求   microsoft   数据访问组件(mdac)   2.6   或更高版本。发现当前安装的版本是   02.10.4202.0。

· 网友精彩回答:

发表者:fangxinggood

1.   select   *   from   [temp]  
        改为  
        select   *   from   [$temp]  
   
  2.   加上runat="server"  
 

发表者:xiaolang88

select   *   from   [temp$]

发表者:luoxue1981

您在装环境的时候安装了mdac吗?

发表者:simon8181

你的系统环境需要安装mdac2.8,   网上有下载的,装上就好使了

发表者:simon8181

楼主留一个信箱,我给你发过去一个看看

发表者:simon8181

不好意思,文件太大,hotmail不行,   你有没有163或者126的?

发表者:simon8181

刚刚发完了,请查收

.
处理 SSI 文件时出错
© 2006-2008 All Rights Reserved