L
Lucky
I need to create an error handler for and ADO
connection. Data is appended periodically from one db
(no primary key) to Access db table and duplicate values
may occasionally occur during this update.
When it occurs, the following error message shows:
"The changes you requested to the table were not
successful because they would create duplicate values in
the index, primary key, or relationship. Change ...etc."
I need to write a code to trap these duplicate values and
update just valid values. I have created the following
statement. It prevents the code from breaking, but if
duplicate values exist no values are appended to the
table:
ErrorHandler:
If cnn.Errors.Count > 0 Then
For Each err In cnn.Errors
cnn.Errors.Clear
Next err
End If
Resume Next
Any suggestions are greatly appreciated.
Thank you.
Lucky
connection. Data is appended periodically from one db
(no primary key) to Access db table and duplicate values
may occasionally occur during this update.
When it occurs, the following error message shows:
"The changes you requested to the table were not
successful because they would create duplicate values in
the index, primary key, or relationship. Change ...etc."
I need to write a code to trap these duplicate values and
update just valid values. I have created the following
statement. It prevents the code from breaking, but if
duplicate values exist no values are appended to the
table:
ErrorHandler:
If cnn.Errors.Count > 0 Then
For Each err In cnn.Errors
cnn.Errors.Clear
Next err
End If
Resume Next
Any suggestions are greatly appreciated.
Thank you.
Lucky