John_neuman
New member
- Joined
- May 7, 2008
- Messages
- 4
- Programming Experience
- 5-10
i am using a Bindinsoure navigator to connect to a Ms Acess 2003 file
I cannot delete a Newly added record but i can delete old records
but for the same Record if i try to delete it after i reopen the application it goes fine. i think the problem is that my dataset is not refred as i add and save the record.
this is my code to Save the record
Try
If Me.Validate() Then
Me.NewBindingSource.EndEdit()
newBindingAdapter.Update(NewDataSet.DB_Worcs_report_documentation)
MsgBox("Update Successful", MsgBoxStyle.Information, "Update")
'Record the Changes Made
' This table will Record any changes Made to the Record its a sepate table than that of the one in bindingsource
Next_sequence = Generate_NextSequence("d:\cs\worcs_data.mdb", ID.Text.ToString, "Tbl_WORCS_Comments", "Doc_ID")
Query = "insert into Tbl_WORCS_Comments ( Doc_ID, Seq_Number, Comm_Text, Comm_Date, User_LogIn ) values( " & CType(ID.Text, Integer) & " , " & Next_sequence & " , '" & Query & "' , '" & Date.Now & "' , '" & LogInID & "')"
Insert_Record("d:\cs\worcs_data.mdb", Query)
Else
MsgBox("Update NOT Successful", MsgBoxStyle.Exclamation, "Update")
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Update Failure")
End Try
HERE IS MY CODE TO DELETE THE RECORD
NewBindingSource.RemoveCurrent()
Me.NewBindingSource.EndEdit()
newBindingAdapter.Update(NewDataSet.DB_Worcs_report_documentation) ' THE ERROR IS THROWN AT THIS LINE
' AND THE ERROR SAYS cONCUREENCY VIOLATION : THE DELETE COMMAND AFFECTED 0 OF EXPECTED 1 RECORDS
NewDataSet.AcceptChanges()
ANYBODY ANY HELP
I cannot delete a Newly added record but i can delete old records
but for the same Record if i try to delete it after i reopen the application it goes fine. i think the problem is that my dataset is not refred as i add and save the record.
this is my code to Save the record
Try
If Me.Validate() Then
Me.NewBindingSource.EndEdit()
newBindingAdapter.Update(NewDataSet.DB_Worcs_report_documentation)
MsgBox("Update Successful", MsgBoxStyle.Information, "Update")
'Record the Changes Made
' This table will Record any changes Made to the Record its a sepate table than that of the one in bindingsource
Next_sequence = Generate_NextSequence("d:\cs\worcs_data.mdb", ID.Text.ToString, "Tbl_WORCS_Comments", "Doc_ID")
Query = "insert into Tbl_WORCS_Comments ( Doc_ID, Seq_Number, Comm_Text, Comm_Date, User_LogIn ) values( " & CType(ID.Text, Integer) & " , " & Next_sequence & " , '" & Query & "' , '" & Date.Now & "' , '" & LogInID & "')"
Insert_Record("d:\cs\worcs_data.mdb", Query)
Else
MsgBox("Update NOT Successful", MsgBoxStyle.Exclamation, "Update")
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Update Failure")
End Try
HERE IS MY CODE TO DELETE THE RECORD
NewBindingSource.RemoveCurrent()
Me.NewBindingSource.EndEdit()
newBindingAdapter.Update(NewDataSet.DB_Worcs_report_documentation) ' THE ERROR IS THROWN AT THIS LINE
' AND THE ERROR SAYS cONCUREENCY VIOLATION : THE DELETE COMMAND AFFECTED 0 OF EXPECTED 1 RECORDS
NewDataSet.AcceptChanges()
ANYBODY ANY HELP