J
jason
Is there an elegant way to check for the REFERENTIAL INTEGRITY VIOLATION in
Access via ASP. The reason I ask is that if the user attempts to refresh the
screen after implementing an INSERT he will be trying to insert an identical
record which thows up the following error (below). I could place On error
resume next before but I find this dangerous or am I overworrying. I could
preface the insert by doing a check for the record but this creates longer
code which warps my anti-debugging frame of mind - is there a better way?
----------- ERROR GENERATED -- WHEN EXECUTING INSERT -------
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.
/catamaranco/listings/tracker.asp, line 93
'On error resume next
SQL = "INSERT INTO tblPageWatch (ListingsID, CustomerID) VALUES ("
SQL=SQL & "'" & Trim(ListingsID) & "', "
SQL=SQL & "'" & CustomerID & "')"
Response.Write "<BR>CustomerID" & CustomerID & "<BR>"
Response.Write SQL
cnn.Execute SQL, , adCmdText
Access via ASP. The reason I ask is that if the user attempts to refresh the
screen after implementing an INSERT he will be trying to insert an identical
record which thows up the following error (below). I could place On error
resume next before but I find this dangerous or am I overworrying. I could
preface the insert by doing a check for the record but this creates longer
code which warps my anti-debugging frame of mind - is there a better way?
----------- ERROR GENERATED -- WHEN EXECUTING INSERT -------
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.
/catamaranco/listings/tracker.asp, line 93
'On error resume next
SQL = "INSERT INTO tblPageWatch (ListingsID, CustomerID) VALUES ("
SQL=SQL & "'" & Trim(ListingsID) & "', "
SQL=SQL & "'" & CustomerID & "')"
Response.Write "<BR>CustomerID" & CustomerID & "<BR>"
Response.Write SQL
cnn.Execute SQL, , adCmdText