关于listview与数据库的问题,请大家帮我看看程序出错在哪?谢谢!!
For i = 1 To lvr71_1.ListItems.Count
If lvr71_1.ListItems(i).Checked Then
aa = lvr71_1.ListItems(i).ListSubItems(2).Text
g_strSQL = "insert r71(
r71_001,r71_002,r71_003,r71_004,r71_005,r71_006,r71_007, r71_008,r71_009,r71_010,r71_011,r71_012,
r71_013,r71_014,r71_015 )" _
& "values( select r71_001,r71_002,r71_003,r71_004,r71_005,r71_006,r71_007,r71_008,0,r71_010,r71_011,'2','" _
& txtto(1).Text & "'," _
& "r71_014,0 " _
& " where r71_001 = '" & txtto(7).Text & "'" _
& "and r71_002 = '" & txtto(8).Text & "'" _
& "and r71_003 = '" & aa & "'" _
& "and r71_012 ='1')"
Debug.Print g_strSQL
g_Cnn.Execute (g_strSQL)
End If
Next
r71表包含着入库单,和出库单,运行时,它显示insert 语句出错,
不好意思,代码没有对齐,看得比较吃力