我把文本text的控件和adodc绑定了,用datagrid显示,
Private Sub cmdAdd_Click()
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew Exit Sub
AddErr:
MsgBox Err.Description
End Sub现在问题是,按添加按钮后,添加一条记录,覆盖了第一条,继续添加就不会覆盖了,请问这是什么原因?谢谢!
Private Sub cmdAdd_Click()
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew Exit Sub
AddErr:
MsgBox Err.Description
End Sub现在问题是,按添加按钮后,添加一条记录,覆盖了第一条,继续添加就不会覆盖了,请问这是什么原因?谢谢!
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew
datPrimaryRS.Recordset.update '加上這句
' Exit Sub 去掉這句
AddErr:
MsgBox Err.Description
End Sub
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew
datPrimaryRS.Recordset.update
Exit Sub
AddErr:
MsgBox Err.Description
End Sub
这样也不行
Private Sub cmdAdd_Click()
On Error GoTo AddErr
datPrimaryRS.Recordset.update datPrimaryRS.Recordset.AddNew
Exit Sub AddErr:
MsgBox Err.Description
End Sub
这样也不行Private Sub cmdAdd_Click()
On Error GoTo AddErr
datPrimaryRS.Recordset.AddNew
datPrimaryRS.recordset.movelast
'a
Exit Sub
AddErr:
MsgBox Err.Description
End Sub
也不行