I have a asp page which upload files to database,I want to add some error handler code to avoid user upload same file twice, but the asp seems doesn't like On Error GoTo ErrorHandler statement, and I tried use On Error Resume Next and it doesn't work either. here is the code to upload file to database:
<!-- #Include file="adovbs.inc" -->
Set theForm = Server.CreateObject("ABCUpload4.XForm")
Set theField = theForm("filefield")(1)
if theField.FileExists then
constring="Provider=MSDAORA.1;Password=XXX;User ID=XXX;Data Source=XXXX;Persist Security Info=True"
strattach="select id,empid,filename,attachcontent from attachtable "
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strattach, objcon,adOpenDynamic ,adLockOptimistic
rs("attachcontent").Value = theField.Data
if you have any idea, please let me know(how to use error handler and where to put these code? is that possiable to pop up a error message box to the user?)
Thanks in advance!