delp hi 批量导入数据 从Excel 中导入数据到Access 中: procedure TForm5
Button3Click(Sender: TObject); //excel 导入 var EXLfile:string; sheet,XLApp,workbook : variant; iRow,MaxRow:integer; begin if opendialog1
Execute then begin EXLfile:=opendialog1
FileName; screen
Cursor:=crHourGlass; try //创建对象 XLApp:=createOleObject('Excel
Application'); XLApp
displayAlerts:=false; //运行宏时是否显示警告和消息 XLApp
ScreenUpdating:=false; //屏幕更新功能,提高速度; XLApp
WorkBooks
Add(EXLfile); workbook := XLApp
workbooks[1]; sheet:=workbook
worksheets[1]; //sheet:=XLApp
WorkBooks[1]
worksheets[1]; //得到最大行数 maxRow XLApp
ActiveCell
SpecialCells(xlLastCell)
Select; maxRow:=XLApp
ActiveCell
Row; //当前行数 //最大行数 //写数据到access 库 with Dm1
aq_temp do begin Close; SQL
Clear ; SQL
Add('select * from peo '); open ; for iRow:=1 to MaxRow d