用SQL语句直接导入比较方便,快捷
1.查询excel
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:/Finance/account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
2.导入
insert into table1(field1, field2, field3, field4, field5)
SELECT a1, a2, a3, a4, a5
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:/Finance/account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
insert into B表 selet * from openrowset('Microsoft.Jet.OLEDB.4.0',
'x:/A.mdb';'admin';'',A表)
select * into aaa from opendatasource('Microsoft.Jet.OLEDB.4.0',
'Data Source="e:/ccc.mdb")...table