无码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的評論 (共 條)

分享到微博請遵守國家法律
台南县| 牡丹江市| 南平市| 米脂县| 油尖旺区| 吉隆县| 富顺县| 兰考县| 永泰县| 左权县| 景宁| 内江市| 湖北省| 青川县| 天台县| 新源县| 乐业县| 苏尼特右旗| 丹东市| 左贡县| 周宁县| 玉树县| 崇仁县| 治多县| 中西区| 建瓯市| 三明市| 勐海县| 石楼县| 天门市| 精河县| 扬州市| 柳州市| 正镶白旗| 重庆市| 云龙县| 阳城县| 云和县| 武穴市| 武宣县| 越西县|