| 发表于:2007-09-18 09:52:494楼 得分:25 |
工程里面引用ado,然后用下面的代码 dim cn as adodb.connection dim rst as adodb.recordset set cn = new adodb.connection with cn .provider = "microsoft.jet.oledb.4.0 " .connectionstring = "data source=c:\book1.xls; " & _ "extended properties=excel 8.0; " .open end with set rst = cn.EXECute( "select * from [sheet1$] ") dim i as integer rst.movefirst do while not rst.eof for i = 0 to rst.fields.count - 1 debug.print rst(i); next debug.print rst.movenext loop | | |
|