Using ADO to Delete records

TJBernard

Registered User.
Local time
Today, 08:33
Joined
Mar 28, 2002
Messages
176
I have an MS Access database that is running ADO code to work against a SQL back-end. I have a form in which the users can delete records out of the database by clicking a button. My code runs correctly and deletes out the record as I expect, but if I either run "Me.Requery" or if I just close the form without requering the data I get this message that states:

"Write Conflict:
The record has been changed by another user since you started editing it. If you save the record, you will over write the changes the other user has made.

Copying the changes to the clipboard will let you look at the values the other user has entered, and then paste your changes back in if you decide to make changes

[Save Record] [Copy To Clipboard] [Drop Changes]"

The changes in the database save correctly, this is just a message on the form. I am not sure how to get around this or turn this option off, but it is unnecessary as I am the only person in the database and I have made no changes to the record.

Thank you for you time,

T.J.
 
Try moving off that record before the delete query is run.
 
write conflict

I am in same situation and received the exact error when I update my records. Were you able to fix this error?

You posted previously:
I have an MS Access database that is running ADO code to work against a SQL back-end. I have a form in which the users can delete records out of the database by clicking a button. My code runs correctly and deletes out the record as I expect, but if I either run "Me.Requery" or if I just close the form without requering the data I get this message that states:

"Write Conflict:
The record has been changed by another user since you started editing it. If you save the record, you will over write the changes the other user has made.

Copying the changes to the clipboard will let you look at the values the other user has entered, and then paste your changes back in if you decide to make changes

[Save Record] [Copy To Clipboard] [Drop Changes]"
 
write conflict

Hello Pat,

I really need your help to find the write conflict error. I've been working on it for days/weeks and still not sure how I can fix it.
I am using Access 2000 fe and SQL SERVER 7.0 as BE
The subform is bound to a table.

Could you please look @ my code
Sub save_shipped_input()
Dim save_shipping_history As New ADODB.Command
Dim clear_temp_fields As New ADODB.Command

Forms!edit_shipping_sched!shipping_sched_list_subform!cust_ord_qty.Locked = False

With save_shipping_history
.ActiveConnection = CurrentProject.Connection
.CommandText = "spUpdate_shipping_sched"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ret_val", adInteger, adParamReturnValue)
:
.Execute , , adExecuteNoRecords

End With



If save_shipping_history.Parameters("ret_val").Value > 0 Then
Forms!edit_shipping_sched!shipping_sched_list_subform!shipped_qty_remaining = Forms!edit_shipping_sched!shipping_sched_list_subform!shipped_qty_temp
MsgBox "There is an error occurred in the record you have entered. Please write down the work order number and contact the IT Department.", vbInformation
Else
Forms!edit_shipping_sched!shipping_sched_list_subform!shipped_qty_remaining.Value = Forms!edit_shipping_sched!shipping_sched_list_subform!shipped_qty_temp.Value - Forms!edit_shipping_sched!shipping_sched_list_subform!shipped_qty.Value
End If



‘’’’’’’’'calls subform_shipping_sched_list beforeUpdate event where write conflict occurred after executing the procedure
Forms!edit_shipping_sched!shipping_sched_list_subform.Requery


Call Form_edit_shipping_sched.enable_disable_form(True)
'Call enable_disable_form(True)

Call Form_edit_shipping_sched.prep_sched_input

Forms!edit_shipping_sched!input_shipped_qtys.Caption = "Enter Shipped &Qty's"


Set save_shipping_history = Nothing
''Set clear_temp_fields = Nothing


End Sub


Subform

Private Sub form_beforeUpdate(Cancel As Integer)

Dim sq As Long, sqrm As Long, sqt As Long, update_qty_remaining As Long

If Not IsNull(Me!shipped_qty) Then
'If Me!shipment_complete = True Then
If IsNull(Me!shipped_date) Then
MsgBox "You entered a shipped quantity but did not enter the date it shipped on.", vbExclamation
Me!shipped_date.SetFocus
Cancel = True
Exit Sub
End If

Else

Me!shipped_date = Null
Me!reason_code = Null
Me!shipment_complete = False
End If

If update_qty_remaining = True Then
If IsNull(Me!shipped_qty) Then
sq = 0
Else

End If

If ..
Else ..
End If

If ..
Else..
..
End If

Me!shipped_qty_remaining = sqrm - (sq - sqt)
Me!shipped_qty_temp.Value = Me!shipped_qty.Value
update_qty_remaining = False
End If

Call tts_reason_code 'write conflict occurred after executing this calling procedure

End Sub

My error code is this:
"Write Conflict:
The record has been changed by another user since you started editing it. If you save the record, you will over write the changes the other user has made.

Copying the changes to the clipboard will let you look at the values the other user has entered, and then paste your changes back in if you decide to make changes

[Save Record] [Copy To Clipboard] [Drop Changes]"

I appreciate any assistance.
 

Users who are viewing this thread

Back
Top Bottom