I have an Ultradev Insert page adding a record, the main primary key is generated. However, it is possible that the user could enter data such that another unique index causes a problem.
I either want to stop this insert if a duplicate is being entered.
Or issue a message telling the user that the details they are entering is a duplicate of another record.
I have tried putting <% On Error Resume Next %> at top of page and then after the execute of the insert command I placed.
<%If Err.Number = "" Then
Response.Write("Error #" & Err.Number &" <br>"
Response.Write("Error Source: " & Err.Source & "<br>"
Response.Write("Error Description: " & Err.Description & "<br>"
Response.end
End If%>
Nothing happens!, the insert is attempted nothing comes out and no record is written.
If I take the <% On Error Resume Next %> out I get an MSaccess database error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
telling me that I cannot add record !!!!!!
Can anybody help?
All non duplicate inserts work fine.
Thank you charles
I either want to stop this insert if a duplicate is being entered.
Or issue a message telling the user that the details they are entering is a duplicate of another record.
I have tried putting <% On Error Resume Next %> at top of page and then after the execute of the insert command I placed.
<%If Err.Number = "" Then
Response.Write("Error #" & Err.Number &" <br>"

Response.Write("Error Source: " & Err.Source & "<br>"

Response.Write("Error Description: " & Err.Description & "<br>"

Response.end
End If%>
Nothing happens!, the insert is attempted nothing comes out and no record is written.
If I take the <% On Error Resume Next %> out I get an MSaccess database error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
telling me that I cannot add record !!!!!!
Can anybody help?
All non duplicate inserts work fine.
Thank you charles