发布网友 发布时间:2022-04-23 02:54
共1个回答
热心网友 时间:2023-10-12 11:21
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strCn As String
Dim strSQL As String
Dim CountryCode As String
Dim CountryName As String
Dim DeleteFlg As String
Dim CreateBy As String
Dim UpdateBy As String
'strCn = "Provider=sqloledb;Server=xxxx;Database=xxxx;Uid=sa;Pwd=sa;"
strCn = strConn
'MsgBox strCn
'open connect
cn.Open strCn
'**********************************************
strSQL = "DELETE FROM xxxx"
cn.Execute strSQL
cn.Close
'get the max row number
Dim RowCount As Integer
RowCount = Sheet3.UsedRange.Rows.Count
'get the time
Dim nowtime As Date
nowtime = Now()
'MsgBox nowtime
Dim index As Integer
For index = 0 To RowCount
'get data from excel
111= Cells(index, 1).Value
2222= Cells(index, 2).Value
DeleteFlg = "0"
3333= Cells(index, 3).Value
4444= Cells(index, 4).Value