Results 1 to 2 of 2


  1. #1
    Join Date
    Dec 1969


    Hello All,<BR><BR>I have a form inserting into a SQL Server db. The form pulls an email address from a field called "email", then sends a confirm email out to that address and redirects to a confirm.htm page. Before I embedded the procedure call into the code, the redirection to confirm.htm worked just fine. Now that I have the call in there, the email IS sent, but I get a page not found and for some reason the URL that shows at Page Not Found is registration.asp (the original FORM page). I know my code is ugly because it&#039;s embedded into Front Page code, but please bare with me... AND I know that I probably did a lot of PROGRAMMER NO NO&#039;s, ie. opening too many record sets... but... I AM trying, I swear ;) PLEASE HELP! The call is about half way through<BR><BR>&#060;%<BR> Dim strSQL<BR> Dim dbconn<BR> Dim dbRs2<BR> Dim dbRs3<BR><BR>strErrorUrl = ""<BR><BR><BR>If Request.ServerVariables("REQUEST_METHOD") = "POST" Then<BR>If Request.Form("VTI-GROUP") = "0" Then<BR> Err.Clear<BR><BR> Set fp_conn = Server.CreateObject("ADODB.Connection")<BR> FP_DumpError strErrorUrl, "Cannot create connection"<BR><BR> Set fp_rs = Server.CreateObject("ADODB.Recordset")<BR> FP_DumpError strErrorUrl, "Cannot create record set"<BR><BR> Set dbRs2 = Server.CreateObject("ADODB.Recordset")<BR> FP_DumpError strErrorUrl, "Cannot create record set"<BR><BR> Set dbRs3 = Server.CreateObject("ADODB.Recordset")<BR> FP_DumpError strErrorUrl, "Cannot create record set"<BR><BR> fp_conn.Open Application("longservice_ConnectionString")<BR> FP_DumpError strErrorUrl, "Cannot open database"<BR><BR> fp_rs.Open "registration", fp_conn, 1, 3, 2 &#039; adOpenKeySet, adLockOptimistic, adCmdTable<BR> FP_DumpError strErrorUrl, "Cannot open record set"<BR><BR>If Request.Form("eligible") &#060;&#062; "YES" Then<BR> &#039;Response.Write "You must check the declaration to proceed"<BR> Response.Redirect "declare.htm"<BR> <BR> <BR>ELSE<BR> strSQL = "SELECT * FROM registration " _ <BR> & " WHERE empid=&#039;" & Request.Form("EmpNum") & "&#039;" <BR> Set dbRs2 = fp_conn.Execute(strSQL) <BR><BR>If dbRs2.EOF Then<BR><BR><BR> fp_rs.AddNew<BR> FP_DumpError strErrorUrl, "Cannot add new record set to the database"<BR> Dim arFormFields0(20)<BR> Dim arFormDBFields0(20)<BR> Dim arFormValues0(20)<BR><BR> arFormFields0(0) = "Ministry"<BR> arFormDBFields0(0) = "ministry"<BR> arFormValues0(0) = Request("Ministry")<BR> arFormFields0(1) = "PostalCode"<BR> arFormDBFields0(1) = "postal"<BR> arFormValues0(1) = Request("PostalCode")<BR> arFormFields0(2) = "AwardYear"<BR> arFormDBFields0(2) = "award_yr"<BR> arFormValues0(2) = Request("AwardYear")<BR> arFormFields0(3) = "HomePhone"<BR> arFormDBFields0(3) = "hm_phn"<BR> arFormValues0(3) = Request("HomePhone")<BR> arFormFields0(4) = "MiddleName"<BR> arFormDBFields0(4) = "mname"<BR> arFormValues0(4) = Request("MiddleName")<BR> arFormFields0(5) = "SupervisorName"<BR> arFormDBFields0(5) = "super_nm"<BR> arFormValues0(5) = Request("SupervisorName")<BR> arFormFields0(6) = "YearsofService"<BR> arFormDBFields0(6) = "yrs_of_serv"<BR> arFormValues0(6) = Request("YearsofService")<BR> arFormFields0(7) = "Prov"<BR> arFormDBFields0(7) = "prov"<BR> arFormValues0(7) = Request("Prov")<BR> arFormFields0(8) = "email"<BR> arFormDBFields0(8) = "email"<BR> arFormValues0(8) = Request("email")<BR> arFormFields0(9) = "City"<BR> arFormDBFields0(9) = "city"<BR> arFormValues0(9) = Request("City")<BR> arFormFields0(10) = "declare"<BR> arFormDBFields0(10) = "declare"<BR> arFormValues0(10) = Request("declare")<BR> arFormFields0(11) = "FirstName"<BR> arFormDBFields0(11) = "fname"<BR> arFormValues0(11) = Request("FirstName")<BR> arFormFields0(12) = "LastName"<BR> arFormDBFields0(12) = "lname"<BR> arFormValues0(12) = Request("LastName")<BR> arFormFields0(13) = "EmpNum"<BR> arFormDBFields0(13) = "empid"<BR> arFormValues0(13) = Request("EmpNum")<BR> arFormFields0(14) = "Address"<BR> arFormDBFields0(14) = "address"<BR> arFormValues0(14) = Request("Address")<BR> arFormFields0(15) = "SupervisorEmail"<BR> arFormDBFields0(15) = "super_email"<BR> arFormValues0(15) = Request("SupervisorEmail")<BR> arFormFields0(16) = "Prefix"<BR> arFormDBFields0(16) = "prfx"<BR> arFormValues0(16) = Request("Prefix")<BR> arFormFields0(17) = "Gender"<BR> arFormDBFields0(17) = "gender"<BR> arFormValues0(17) = Request("Gender")<BR> arFormFields0(18) = "WorkPhone"<BR> arFormDBFields0(18) = "wrk_phn"<BR> arFormValues0(18) = Request("WorkPhone")<BR> arFormFields0(19) = "SupervisorPhone"<BR> arFormDBFields0(19) = "super_phn"<BR> arFormValues0(19) = Request("SupervisorPhone")<BR><BR> FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0<BR><BR> fp_rs.Update<BR> FP_DumpError strErrorUrl, "Cannot update the database"<BR><BR>&#039;**** HERE IS THE CALL THAT I PUT IN THAT WORKS, BUT WON&#039;T REDIRECT FOLLOWING, AS IT DID BEFORE<BR><BR>Set dbRs3 = fp_conn.Execute("exec longservice.dbo.gov_mail @recipient_email=&#039;"& Request.Form("email") & "&#039;,@message_email=&#039;Confirmation Email of Registration&#039;") <BR><BR> dbrs2.close<BR> dbrs3.close<BR> fp_rs.Close<BR> fp_conn.Close<BR><BR> Session("FP_SavedFields")=arFormFields0<BR> Session("FP_SavedValues")=arFormValues0<BR> Response.Redirect "confirm.htm"<BR> <BR> <BR>ELSE<BR> Response.Redirect "exists.htm"<BR><BR>End If<BR><BR>End If<BR>End If<BR>END IF<BR><BR>%&#062;<BR>...html form...

  2. #2
    Join Date
    Dec 1969

    Default So debug...

    &#060;%<BR>...<BR><BR>SQL = "exec longservice.dbo.gov_mail @recipient_email=&#039;"& Request.Form("email") & "&#039;,@message_email=&#039;Confirmation Email of Registration&#039;"<BR><BR>Response.Write "ready to do:&#060;br/&#062;" & SQL & "&#060;HR&#062;"<BR><BR>fp_conn.Execute SQL<BR><BR>Response.Write "SQL was executed"<BR><BR>dbrs2.close<BR>fp_rs.Close<BR>fp_ conn.Close<BR><BR>Session("FP_SavedFields")=arForm Fields0<BR>Session("FP_SavedValues")=arFormValues0 <BR><BR>&#039; COMMENT OUT: Response.Redirect "confirm.htm"<BR>Response.Write "Would have done redirect to confirm.htm&#060;HR&#062;"<BR><BR>Response.End<BR> ...<BR>%&#062;<BR><BR>There is no point of assigning the result of the Execute to a recordset if you aren&#039;t going to *USE* that result. Not that I think that has anything to do with the problem.<BR><BR>

Posting Permissions

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