Private Sub add123_Click()
x = Val(DataGrid1)
Adodc1.Recordset.MoveLast
Set cmd.ActiveConnection = conn
Do While y > x + 1
y = Val(DataGrid1)
z = y + 1
cmd.CommandText = "update 传动轴参数表 set 传动轴号='" & z & "' where 传动轴号='" & y & " '"
cmd.Execute
Adodc1.Recordset.MovePrevious
Loop
cmd.CommandText = "insert into 传动轴参数表('传动轴号','l1','l2','导程') values('" & y & "',0,0,0)"
cmd.Execute
Adodc1.Refresh
End Sub
那里出错了呢,发现do ---while 语句没起到作用,为什么呢