Help with error handling

Results 1 to 2 of 2

Thread: Help with error handling

  1. #1
    Join Date
    Dec 1969
    Posts
    33

    Default Help with error handling

    I am trying to create an error handling subroutine for my asp page. Could someone tell me where I am going wrong. Here is my code:-<BR><BR>&#060;%@ LANGUAGE="VBScript" %&#062;<BR>&#060;%<BR>Dim objConn, objRS, strQuery,SQL1, SQL2, strConnection<BR>set objConn = Server.CreateObject("ADODB.Connection")<BR>strConn ection = "DSN=Custom_Feedback_Database_Conn"<BR>%&#062;<BR> <BR>&#060;HTML&#062;<BR>&#060;HEAD&#062;<BR><BR>&# 060;TITLE&#062;HelpDesk entry&#060;/TITLE&#062;<BR>&#060;/HEAD&#062;<BR><BR>&#060;% If (0 = Request.ServerVariables("CONTENT_LENGTH")) Then %&#062;<BR><BR>&#060;h1&#062;&#060;CENTER&#062;&#0 60;FONT size=6&#062;Help Desk Feedback Form &#060;/FONT&#062;&#060;/CENTER&#062;<BR><BR>&#060;CENTER&#062;&#060;FONT size=5&#062;ENERGi Business Systems &#060;/FONT&#062;&#060;/CENTER&#062;<BR><BR>&#060;P&#062;&#060;FONT size=3&#062;Our records indicate that you contacted the computer help desk. <BR>Please take a minute to tell us how we did by completing the following questionnaire. &#060;/H1&#062;<BR><BR>&#060;FORM ACTION="&#060;%=Request.ServerVariables("SCRIPT_NA ME")%&#062;" method=post&#062;<BR><BR>&#060;/FONT&#062;&#060;/P&#062;<BR>&#060;A name=section0question1&#062;&#060;/A&#062;&#060;INPUT name=P0:1. <BR>type=hidden <BR>value=" Overall, how pleased were you with the service you received? "&#062; <BR>&#060;TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"&#062;<BR> &#060;TBODY&#062;<BR><BR>&#060;TR&#062;<BR> &#060;TD width=1&#062;*&#060;/TD&#062;<BR> &#060;TD bgColor=#00cccc width=1&#062;*&#060;/TD&#062;<BR> &#060;TD width="1%"&#062;*&#060;/TD&#062;<BR> &#060;TD width="98%"&#062;&#060;FONT size=+1&#062;&#060;B&#062;1&#060;/B&#062;. Overall, how pleased were you <BR> with the service you received? &#060;/FONT&#062;&#060;/TD&#062;&#060;/TR&#062;<BR> &#060;TR&#062;<BR> &#060;TD width=1&#062;*&#060;/TD&#062;<BR> &#060;TD bgColor=#00cccc width=1&#062;*&#060;/TD&#062;<BR> &#060;TD width="1%"&#062;*&#060;/TD&#062;<BR> &#060;TD width="98%"&#062;&#060;INPUT name=s0q1a1 type=radio value=1&#062; Very displeased <BR> <BR>&#060;INPUT name=s0q1a1 type=radio value=2&#062; Somewhat displeased <BR> <BR>&#060;INPUT name=s0q1a1 type=radio value=3&#062; Neither pleased nor <BR> displeased <BR>&#060;INPUT name=s0q1a1 type=radio value=4&#062; Somewhat pleased <BR> <BR>&#060;INPUT name=s0q1a1 type=radio value=5&#062; Very pleased <BR><BR>&#060;/TD&#062;&#060;/TR&#062;&#060;/TBODY&#062;&#060;/TABLE&#062;<BR><BR>&#060;A name=section0question2&#062;&#060;/A&#062;&#060;INPUT name=P0:2. <BR>type=hidden value=" Was your problem resolved? "&#062; <BR>&#060;TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"&#062;<BR> &#060;TBODY&#062;<BR> &#060;TR&#062;<BR> &#060;TD width=1&#062;*&#060;/TD&#062;<BR> &#060;TD bgColor=#00cccc width=1&#062;*&#060;/TD&#062;<BR> &#060;TD width="1%"&#062;*&#060;/TD&#062;<BR> &#060;TD width="98%"&#062;&#060;FONT size=+1&#062;&#060;B&#062;2&#060;/B&#062;. Was your problem resolved? <BR> &#060;/FONT&#062;&#060;/TD&#062;&#060;/TR&#062;<BR> &#060;TR&#062;<BR> &#060;TD width=1&#062;*&#060;/TD&#062;<BR> &#060;TD bgColor=#00cccc width=1&#062;*&#060;/TD&#062;<BR> &#060;TD width="1%"&#062;*&#060;/TD&#062;<BR> &#060;TD width="98%"&#062;&#060;INPUT name=s0q2a1 type=radio value=1&#062; Yes &#060;INPUT <BR> name=s0q2a1 type=radio value=2&#062; No &#060;/TD&#062;&#060;/TR&#062;&#060;/TBODY&#062;&#060;/TABLE&#062;<BR><BR>&#060;TD&#062;<BR>&#060;INPUT TYPE="submit" VALUE="Submit Entry"&#062;<BR>&#060;INPUT TYPE="reset" VALUE="Clear"&#062;<BR>&#060;/TD&#062;<BR>&#060;/FORM&#062;<BR>&#060;/TABLE&#062;<BR><BR>&#060;%<BR>IF request("s0q1a1") = "" OR request("s0q2a1") = "" THEN %&#062;<BR><BR>&#060;H1&#062;Guestbook entry rejected&#060;/H1&#062;<BR>Sorry, but your guestbook entry could not be accepted. You didn&#039t provide<BR>all information:<BR><BR>&#060;P&#062;<BR>&#060;B&#062; &#060;%=strErrorString%&#062;&#060;/B&#062;<BR>&#060;P&#062;<BR>Please use the &#060;B&#062;Back&#060;/B&#062; button of your browser to go back and supply the missing information.<BR><BR>&#060;%<BR>ELSE<BR><BR>strQuer y = "INSERT INTO tQuestions1 (Q1_Customer_Service_Level,Q2_WAS_PROBLEM_RESOLVED ) Values(&#039" & request("s0q1a1") & "&#039,&#039" & request("s0q2a1") & "&#039)"<BR><BR>objConn.Open strConnection<BR>objConn.Execute(strquery)<BR>ObjC onn.Close<BR>Set ObjConn = Nothing<BR><BR>%&#062;<BR><BR>&#060;H1&#062;HelpDe sk entry inserted!&#060;/H1&#062;<BR>Thank you for your entry<BR><BR>&#060;A HREF="http://energi-net/guestbook/Helpdesk2.asp"&#062;Back&#060;/A&#062; Back to HelpDesk Form&#060;/P&#062;<BR><BR>&#060;%<BR>END IF<BR>END IF<BR>%&#062;<BR>&#060;/HTML&#062;<BR> <BR>After I have inserted the error handler, somehow it won&#039t send any information into the database. <BR><BR>Thanks ever so much for your help,<BR><BR><BR>Juliet<BR><BR><BR><BR><BR>

  2. #2
    J Guest

    Default RE: Help with error handling

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •