On Error Resume Next

This is a discussion on "On Error Resume Next" within the Classic ASP section. This forum, and the thread "On Error Resume Next are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 1st, 2004, 12:14
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
On Error Resume Next

this is the code that will open a page "duplication_bn.asp" if there is a duplication in the submitted form!

i have set 3 primary key to my database!

Code: Select all
<% On Error Resume Next %>
Code: Select all
<%
set bn = Server.CreateObject("ADODB.Recordset")
bn.ActiveConnection = MM_bn_STRING
bn.Source = "SELECT * FROM BN"
bn.CursorType = 0
bn.CursorLocation = 2
bn.LockType = 3
bn.Open()
bn_numRows = 0

If Err.number <> 0 then
  Response.Redirect "duplication_bn.asp"
End If
%>

this code will open the page "go_here_after_submit_bn.asp" after the user submit the form!
Code: Select all
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) <> "") Then

  MM_editConnection = MM_bn_STRING
  MM_editTable = "BN"
  MM_editRedirectUrl = "go_here_after_submit_bn.asp"
  MM_fieldsStr  = "bnRoom|value|bnTime|value|bnDay|value|bnSubject|value|bnSection|value"
  MM_columnsStr = "bnRoom|',none,''|bnTime|',none,''|bnDay|',none,''|bnSubject|',none,''|bnSection|',none,''"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
  Next

  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If

End If
%>
the problem is, i cannot use both of this code together!
when i use both of them, the "on error resume" next will not be functioning!

what i want is, when there is a duplication in my database, the "duplication_bn.asp" will be display (using on error resume next),
and when the submitted form dont have any duplication, then open "go_here_after_submit_bn.asp"

any idea?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Closed Thread

Tags
error, resume, next

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
My super resume - I Hate firefox ! vandiermen Free Web Site Critique 18 Sep 18th, 2007 21:03
Keep getting error message Microsoft VBScript runtime error '800a01a8' cpando1974 Classic ASP 2 Aug 7th, 2007 12:00
Error 500 - Internal server error JasonStanley PHP Forum 3 Apr 23rd, 2007 17:56
CV/resume review, please snow Webforumz Cafe 11 Jan 4th, 2007 20:43


All times are GMT. The time now is 04:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43