import console;
import godking.libxl
import godking.conn
var book = godking.libxl.open("/tab.xlsx",)
var sheet = book.sheet()
var conn = godking.conn.openAccess( "/tab.accdb", )
// 方法一:数组数据
var list = sheet.getTable(2,1,0,0,null,'');
console.dump(list)
for(i=1;#list;1){
// 方法一:
conn.exec("insert into tab(xingming,nianling) values(?)",{list[i]});
// 方法二:
conn.exec("insert into tab(xingming,nianling) values(?,?)",list[i]);
}
var t = conn.getTable( "select * from [tab]",false,0,0 )
console.dump(t)
// 方法二:字典数据
var list = sheet.getTable(1,1,0,0,1,'');
console.dump(list)
for(i=1;#list;1){
conn.exec("insert into tab(xingming,nianling) values(@姓名,@年龄)",list[i])
}
var t = conn.getTable( "select * from [tab]",false,0,0 )
console.dump(t)
book.close();
conn.close();
console.pause(true);