0
我目前使用的設置如下。將Excel擴展表導出到具有時間戳的訪問表?
Set AccessConn = CreateObject("ADODB.Connection")
sExcel = "[Excel 8.0;HDR=YES;IMEX=2;DATABASE=" & ThisWorkbook.FullName & "].[Sheet1$]"
AccessConn.Open "DSN=Foo", "", ""
sSQL = "Insert Into BarTable Select * FROM " + sExcel
AccessConn.Execute sSQL
現在,如果我想在導出中添加一個now()列,這有可能嗎?像
Set AccessConn = CreateObject("ADODB.Connection")
sExcel = "[Excel 8.0;HDR=YES;IMEX=2;DATABASE=" & ThisWorkbook.FullName & "].[Sheet1$]"
AccessConn.Open "DSN=Foo", "", ""
sSQL = "Insert Into BarTable Select *,NOW() FROM " + sExcel
AccessConn.Execute sSQL
BarTable中的最後一列是日期/時間列,我想插入當前時間?