无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

VB把excel數(shù)據(jù)插入access

2022-03-20 17:09 作者:實習(xí)證明三方免  | 我要投稿

Private Sub CommandButton1_Click()


Set Cnn = CreateObject("ADODB.Connection")

Set Rst = CreateObject("ADODB.Recordset")

Dim stPath As String

Dim strSQL As String

Dim aa As Variant

Dim i As Integer

Dim arrFid As Variant

aa = Timer

MsgBox "準(zhǔn)備傳數(shù)據(jù)到數(shù)據(jù)庫,請稍等!", vbInformation, "溫馨提示"

stPath = ThisWorkbook.Path & Application.PathSeparator & "人力資源管理系統(tǒng).mdb"



Cnn.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & stPath & ";Jet OLEDB:Database Password=" & "access"


Cnn.Execute "DELETE * FROM 車間計件工資數(shù)據(jù)庫"



'刪除所有紀(jì)錄

strSQL = "Select * from 車間計件工資數(shù)據(jù)庫"

Rst.Open strSQL, Cnn, 1, 3


arrFid = Array("prj_NO", "S_Exp", "S_X", "S_Y", "S_Deep", "E_Exp", "E_X", "E_Y")


With Sheets("綜合線表")

For i = 2 To .Range("a65536").End(xlUp).Row '數(shù)組添加比單個添加快很多!

Rst.AddNew arrFid, Array(i - 2, Str(.Cells(i, 1)), Str(.Cells(i, 2)), Val(.Cells(i, 3)), Val(.Cells(i, 4)), Val(.Cells(i, 5)), Str(.Cells(i, 6)), Val(.Cells(i, 7)))

Next

End With


? ? ?Rst.Close: Set Rst = Nothing

? ? ?Cnn.Close: Set Cnn = Nothing


MsgBox "寫入數(shù)據(jù)" & [a2].End(xlDown).Row - 1 & "行" & vbCrLf & "傳輸完畢:耗時" & Format(Timer - aa, "0.000") & "秒", vbInformation, "溫馨提示"

Application.OnTime Now + TimeValue("00:50:00"), "chuanshu"


End Sub




VB把excel數(shù)據(jù)插入access的評論 (共 條)

分享到微博請遵守國家法律
容城县| 乡宁县| 和顺县| 西乡县| 长垣县| 体育| 万荣县| 湖口县| 务川| 佳木斯市| 兴城市| 顺昌县| 肥东县| 定远县| 田阳县| 梓潼县| 祁阳县| 灵宝市| 连城县| 青浦区| 闻喜县| 宜都市| 胶南市| 昌吉市| 镇康县| 伊宁市| 工布江达县| 荔波县| 大名县| 霍山县| 和顺县| 云霄县| 丰城市| 沈阳市| 楚雄市| 司法| 定襄县| 长沙市| 泽普县| 巴马| 沁源县|