|
本帖最后由 lusheng0028 于 2011-7-12 10:16 编辑
就是不会读取表的字段名称还要写进excel中
#include <Array.au3>
#include <Excel.au3>
#include <SQLite.au3>
Local $role
Local $aResult, $iRows, $iColumns, $iRval
$Connection ="DRIVER={MICROSOFT ODBC FOR ORACLE};Server=orcl;User Id=ll;Password=123"
$adoCon=ObjCreate("ADODB.Connection");建立ADO对象
$adoCon.open($Connection)
$adoRs=ObjCreate("ADODB.Recordset");建立数据集对象
$adoRs.ActiveConnection=$adoCon ;绑定连接
$adoRs.open("select * from ballll")
$oExcel=objcreate("excel.application")
$oExcel.visible=true
$oExcel.workbooks.add
With $oExcel.activesheet
.range("A1").copyfromrecordset($adoRs)
EndWith
$adoRs.close
$adoCon.close
_ExcelBookSaveAs($oExcel, "e:\temp2.xls", "xls", 0, 1)
$oExcel.close |
|