又是一个关于EXCEL文件导入mdb后台的问题
当只需要导入excel文件的第一列时,我已经能实现,代码如下:
... ... ...
sql = "SELECT * FROM [Sheet1$]"
set rs = conn2.execute(sql)
... ... ...
while not rs.eof
sql = "insert into ab_tbl2(yexm,sfsb_id) values('"& fixsql(rs(0)) &"','"&session("sfsb_id")&"')"
conn.execute(sql)
rs.movenext
... ... ...
... ... ...
sql = "SELECT * FROM [Sheet1$]"
set rs = conn2.execute(sql)
... ... ...
while not rs.eof
sql = "insert into AB_tbl2(AAA,BBB,CCC) values('"& fixsql(rs.Fields("AAA")) &"','"& fixsql(rs.Fields("BBB")) &"','"&session("sfsb_id")&"')"
conn.execute(sql)
rs.movenext
wend