部门需要一个表,这个表字段很多,我也是检查过了,但不知道为什么会发生自动化错误,拜托大神帮忙看一看问题出现在哪里了
- mycolumn = "(ID,traName,conNum,fConNum,orderNum,conName,inveAmount,conAmount,paperTime,backTime,finalAmount,inAmount,certainTime,invoAmoDetail,invoAmoSum,invoTime,fundAmount,fundTime,compute1,compute2,compute3,compute4,compute5,profession,represent,pricipal,onlineTime,age,reason,fileTime,inBudget,fundBudget,actFinish,Jan,Feb,Mar,Apr,May,June,July,Aug,Sept,Oct,Dec,addupAmount,fPercent,listName)"
- myStr = "values("
- myStr = myStr & "" & Cells(4, 1) & ",'" & Cells(4, 2) & "','" & Cells(4, 3) _
- & "','" & Cells(4, 4) & "','" & Cells(4, 5) & "','" & Cells(4, 6) & "'," & Cells(4, 7) & "," & Cells(4, 8) & ",'" & Cells(4, 9) & "','" & Cells(4, 10) & "'," & Cells(4, 11) & "," & Cells(4, 12) & ",'" & Cells(4, 13) & "', '" & Cells(4, 14) & "', '" & Cells(4, 15) & "','" & Cells(4, 16) & "'," & Cells(4, 17) & ",'" & Cells(4, 18) & "'," & Cells(4, 19) & "," & Cells(4, 20) & "," & Cells(4, 21) & "," & Cells(4, 22) & "," & Cells(4, 23) & ",'" & Cells(4, 24) & "','" & Cells(4, 25) & "','" & Cells(4, 26) _
- & "','" & Cells(4, 27) & "','" & Cells(4, 28) & "','" & Cells(4, 29) & "','" & Cells(4, 30) & "'," & Cells(4, 31) & "," & Cells(4, 32) & "," & Cells(4, 33) & "," & Cells(4, 34) & "," & Cells(4, 35) & "," & Cells(4, 36) & "," & Cells(4, 37) & "," & Cells(4, 38) & "," & Cells(4, 39) & "," & Cells(4, 40) & "," & Cells(4, 41) & "," & Cells(4, 42) & "," & Cells(4, 43) & "," & Cells(4, 44) _
- & "," & Cells(4, 45) & "," & Cells(4, 46) & "," & Cells(4, 47) & ",'" & Cells(4, 48) & "')"
- Sql = "insert into list " & mycolumn & " " & myStr
- cnn.Execute Sql
复制代码
|