/*
ACCESS与EXCEL文件的互导
一、将表导出为EXCEL07-2003表:
Select * INTO [EXCEL 8.0;DATABASE=E:\TEMP\info.XLS].info
FROM Sheet2;
二、将表导出为EXCEL2007/2010表(二进制):
Select * INTO [EXCEL 12.0;DATABASE=E:\TEMP\info.XLSB]. info
FROM Sheet2;
三、将表导出为EXCEL2007/2010表(XML):
Select * INTO [EXCEL 12.0 XML;DATABASE=E:\temp\text.xlsx].sheet1 FROM Sheet2;
四、将EXCEL表导入到现有表中:
Insert INTO ABC Select * FROM [EXCEL 12.0 XML;DATABASE=E:\temp\text.xlsx].sheet1;
五、导入EXCEL表并生成新表:
Select * INTO ABC FROM [EXCEL 12.0 XML;DATABASE=E:\temp\text.xlsx].sheet1;
*/
conn:=ComObjCreate("ADODB.connection")
connectionStrings := "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" A_ScriptDir "\test\TestDB.mdb"
conn.Open(connectionStrings)
Sql:="Select * INTO test4 FROM [Excel 12.0 Xml;HDR=YES;DATABASE=X:\AHK\CSV\test.xls].[Sheet1$];"
conn.execute(Sql)
conn.Close
conn:=
return
[AHK]Access和Excel之间导入导出玩法
最新推荐文章于 2022-03-11 15:05:53 发布