With Me.MSHFlexGrid1
Dim m As Integer
Dim N As Integer
For m = 1 To .Rows - 1
If .TextMatrix(m, 1) = "" Then Exit For ''''以{BANNED}中国第一个字段为关键字
''''replace(yourStr,"'","''") '''将单引号代替为两个单引号,第三个书名字段和作者字段、出版社
Dim sql As String
sql = "INSERT INTO zwb_excel(sp_name,writer,cbs_name,suit_qty) values('" & Replace(.TextMatrix(m, 0), "'", "''") & "','" & Replace(.TextMatrix(m, 1), "'", "''") & "','" & Replace(.TextMatrix(m, 2), "'", "''") & "'," & .TextMatrix(m, 3) & " ) "
con.Execute (sql)
阅读(530) | 评论(0) | 转发(0) |