什么叫多步操作产生错误啊?
我想把MsflexGrid1里的值存到数据库中,代码如下:
Private Sub Command3_Click()
Dim strsql As String
Dim RS1 As New ADODB.Recordset
Set RS1.ActiveConnection = cn
RS1.CursorLocation = adUseClient
RS1.CursorType = adOpenKeyset
RS1.LockType = adLockOptimistic
strsql = "SELECT * FROM csh优化配载查询表 "
RS1.Open strsql
RS1.AddNew
With MSFlexGrid1
RS1!六up1 = .TextMatrix(2, 1)
RS1!六up2 = .TextMatrix(2, 2)
RS1!六up3 = .TextMatrix(2, 3)
RS1!六up4 = .TextMatrix(2, 4)
RS1!六up5 = .TextMatrix(2, 5)
RS1!六up6 = .TextMatrix(2, 6)
RS1!六up装载率 = .TextMatrix(2, 7)
RS1!五up1 = .TextMatrix(3, 1)
RS1!五up2 = .TextMatrix(3, 2)
RS1!五up3 = .TextMatrix(3, 3)
RS1!五up4 = .TextMatrix(3, 4)
RS1!五up5 = .TextMatrix(3, 5)
RS1!五up装载率 = .TextMatrix(3, 7)
RS1!四up1 = .TextMatrix(4, 1)
RS1!四up2 = .TextMatrix(4, 2)
RS1!四up3 = .TextMatrix(4, 3)
RS1!四up4 = .TextMatrix(4, 4)
RS1!四up装载率 = .TextMatrix(4, 7)
RS1!三up1 = .TextMatrix(5, 1)
RS1!三up2 = .TextMatrix(5, 2)
RS1!三up3 = .TextMatrix(5, 3)
RS1!三up装载率 = .TextMatrix(5, 7)
RS1!六down1 = .TextMatrix(7, 1)
RS1!六down2 = .TextMatrix(7, 2)
RS1!六down3 = .TextMatrix(7, 3)
RS1!六down4 = .TextMatrix(7, 4)
RS1!六down5 = .TextMatrix(7, 5)
RS1!六down6 = .TextMatrix(7, 6)
RS1!六down装载率 = .TextMatrix(7, 7)
RS1!五down1 = .TextMatrix(8, 1)
RS1!五down2 = .TextMatrix(8, 2)
RS1!五down3 = .TextMatrix(8, 3)
RS1!五down4 = .TextMatrix(8, 4)
RS1!五down5 = .TextMatrix(8, 5)
RS1!五down装载率 = .TextMatrix(8, 7)
RS1!四down1 = .TextMatrix(9, 1)
RS1!四down2 = .TextMatrix(9, 2)
RS1!四down3 = .TextMatrix(9, 3)
RS1!四down4 = .TextMatrix(9, 4)
RS1!四down装载率 = .TextMatrix(9, 7)
RS1!三down1 = .TextMatrix(10, 1)
RS1!三down2 = .TextMatrix(10, 2)
RS1!三up3 = .TextMatrix(10, 3)
RS1!三装载率 = .TextMatrix(10, 7)
End With
RS.Update
End Sub
运行后就报错:“多步操作产生错误,请检查每步状态值”
请高手帮忙
[解决办法]
应该是RS1!四up3的数据格式有问题,.TextMatrix(4, 3)存不进去。