Hi,
I am trying to trap an error, so that the user will not see it, and that the next line will be excetuted (redirection).
I created on purpose "0x80004005" error, and it is not trapped, but it is shown on whole page for all to see, and does not continue from there. Why is my traaping ignored?
I use no sub/functions. All as main data.
The error refers to trying to insert a new record to MS-ACCESS db containing an existing ID, when ID IS teh key field (thus unique, as should be).
The error:"Microsoft JET Database Engine (0x80004005)
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."
How can I trap the error, and my is my trapping ignored?
---------------------------
CODE:
---------------------------
On error resume next
'Opening db+recordset...
'Exceuting sql statement (Insert)
'error handling:
IF objDB.errors.count>0 then
response.write "Database Errors"
else
response.write("great"
end if
If err.number>0 then
response.write "VBScript Errors"
'Closing recordset and db and setting to nothing
Response.Redirect (mySite)
--------------------------------------------
--------------------------------------------
Not trapped, I get the above default error, and the redirection does not take place.
Helpppppp
Thanks
I am trying to trap an error, so that the user will not see it, and that the next line will be excetuted (redirection).
I created on purpose "0x80004005" error, and it is not trapped, but it is shown on whole page for all to see, and does not continue from there. Why is my traaping ignored?
I use no sub/functions. All as main data.
The error refers to trying to insert a new record to MS-ACCESS db containing an existing ID, when ID IS teh key field (thus unique, as should be).
The error:"Microsoft JET Database Engine (0x80004005)
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."
How can I trap the error, and my is my trapping ignored?
---------------------------
CODE:
---------------------------
On error resume next
'Opening db+recordset...
'Exceuting sql statement (Insert)
'error handling:
IF objDB.errors.count>0 then
response.write "Database Errors"
else
response.write("great"
end if
If err.number>0 then
response.write "VBScript Errors"
'Closing recordset and db and setting to nothing
Response.Redirect (mySite)
--------------------------------------------
--------------------------------------------
Not trapped, I get the above default error, and the redirection does not take place.
Helpppppp
Thanks