您当前的位置:同创IT编程技术VB其他 → 文章信息

excel导入datagrid出现找不到可安装的ISAM

我的代码是  Dim   namestring   As   String  CommonDialog1.Filter   =   "*.txt ¦*.txt ¦*.excel ¦*.xls"  CommonDialog1.Action   =   1  namestring   =   CommonDialog1.FileName                                Dim   cn               As   New   ADODB.Connection,   rs                           As   New   ADODB.Recordset                                cn.CursorLocation   =   adUseClient                                cn.Open   "rovider=Microsoft.Jet.OLEDB.4.0ersist   Security   Info=False;DataSource=namestring;Extended         Properties=Excel8.0;"                                rs.Open   "select         *         from         [Sheet1$]",   cn,   adOpenDynamic,   adLockOptimistic                                Set   DataGrid1.DataSource   =   rs  我安装的是office2007,但我导入的文件是97--2003版的  是不是和版本有关  我不知道错在哪.请指教,谢谢
cn.Open   "rovider=Microsoft.Jet.OLEDB.4.0ersist   Security   Info=False;Data   Source="   &   namestring   &   ";Extended                     Properties=Excel   8.0;"   
回复一楼的朋友  我按你的方法改了,还是一样的错误.怎么做啊?
"rovider=Microsoft.Jet.OLEDB.4.0ersist         Security         Info=False;Data         Source="  Source=   的后面被论坛多加了一个空格,要去掉啊
office97   需要引用   Microsoft   DAO   3.51   Object   Library  office2000,2003   需要引用   Microsoft   DAO   3.6   Object   Library
《中华人民共和国信息产业部ICP证备案》:桂ICP备06003915号 
Copyright © 2006-2008 tctl.com.cn. All Rights Reserved .

mail:474302153#qq.com(#替换为@)