2024-10-15 08:25:50
思路:
set sht = ThisWorkbook.Worksheets("员工信息")
arr = [B3:AT3]
For i = 4 To Range("c65536").End(xlUp).Row
k = 1
For j = 1 To 45
If j = 8 Or j = 9 Or j = 10 Then
Else
如果不是最后一个就{
str1 = str1 & arr(1, k)&",";
str2 = str2 & "'"&sht.Cells(i, j + 1) & "',"
}
否则{
str1 = str1 & arr(1, k);
str2 = str2 & "'"&sht.Cells(i, j + 1) & "'"
}
cn.Execute strSQL
End If
k = k + 1
Next
Next
strSQL="insert into yuangongxinxi("&str1&") values("&str2&")";
你好,你提供的思路没有问题,但是str1与str2字符太长超过255时如何解决啊