Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Using a form to capture data on my website

I am using FP 2002. I have setup on my website a form for people to fill out using a template in FP with an access databse to capture the information. When they fill out the form and click submit, the next page is a form confirmation page with what they filled out. I have heard from some people that they have filled out the form and have the confirmation, but the information is not in the database. It appears to happen around 10% of the time. I am not sure why this is happening as I am unable to duplicate the problem myself. Any help appreciated.

Tom
0
Tomcpt
Asked:
Tomcpt
  • 2
1 Solution
 
CWS (haripriya)Commented:
When it is added to the database, during the submit or by the another submit in the confirmation page? You have to carefully go througth the coding if it gets saved even if you leave some fields blank or enter invalid data. Check the code carefully or post the code here for us to check.
0
 
TomcptAuthor Commented:
I am relatively new at this. But I copied the code that was generated from the form. Thank you for your interest.

' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
      Err.Clear

      Set fp_conn =  Server.CreateObject("ADODB.Connection")
      FP_DumpError strErrorUrl, "Cannot create connection"

      Set fp_rs = Server.CreateObject("ADODB.Recordset")
      FP_DumpError strErrorUrl, "Cannot create record set"

      fp_conn.Open Application("SNFneedsform_ConnectionString")
      FP_DumpError strErrorUrl, "Cannot open database"

      fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
      FP_DumpError strErrorUrl, "Cannot open record set"

      fp_rs.AddNew
      FP_DumpError strErrorUrl, "Cannot add new record set to the database"
      Dim arFormFields0(11)
      Dim arFormDBFields0(11)
      Dim arFormValues0(11)

      arFormFields0(0) = "OT/OTA Treatment hours"
      arFormDBFields0(0) = "OT/OTA_Treatment_hours"
      arFormValues0(0) = Request("OT/OTA Treatment hours")
      arFormFields0(1) = "Revision"
      arFormDBFields0(1) = "Revision"
      arFormValues0(1) = Request("Revision")
      arFormFields0(2) = "OT Evals"
      arFormDBFields0(2) = "OT_Evals"
      arFormValues0(2) = Request("OT Evals")
      arFormFields0(3) = "PT hrs for aid supervision"
      arFormDBFields0(3) = "PT_hrs_for_aid_supervision"
      arFormValues0(3) = Request("PT hrs for aid supervision")
      arFormFields0(4) = "Date of Needs"
      arFormDBFields0(4) = "Date_of_Needs"
      arFormValues0(4) = Request("Date of Needs")
      arFormFields0(5) = "Specialneeds"
      arFormDBFields0(5) = "Specialneeds"
      arFormValues0(5) = Request("Specialneeds")
      arFormFields0(6) = "Time of Request"
      arFormDBFields0(6) = "Time_of_Request"
      arFormValues0(6) = Request("Time of Request")
      arFormFields0(7) = "Facility Name"
      arFormDBFields0(7) = "Facility_Name"
      arFormValues0(7) = Request("Facility Name")
      arFormFields0(8) = "PT Evals"
      arFormDBFields0(8) = "PT_Evals"
      arFormValues0(8) = Request("PT Evals")
      arFormFields0(9) = "PT/PTA Treatment hours"
      arFormDBFields0(9) = "PT/PTA_Treatment_hours"
      arFormValues0(9) = Request("PT/PTA Treatment hours")
      arFormFields0(10) = "ST Hours"
      arFormDBFields0(10) = "ST_Hours"
      arFormValues0(10) = Request("ST Hours")

      FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

      If Request.ServerVariables("REMOTE_HOST") <> "" Then
            FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name"
      End If
      FP_SaveFieldToDB fp_rs, Now, "Timestamp"

      fp_rs.Update
      FP_DumpError strErrorUrl, "Cannot update the database"

      fp_rs.Close
      fp_conn.Close

      FP_FormConfirmation "text/html; charset=windows-1252",_
                                    "Form Confirmation",_
                                    "Thank you for submitting the following information:",_
                                    "SNFneedsform.asp",_
                                    "Return to the form."

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
0
 
CWS (haripriya)Commented:
First of all you should stop using the statement "On Error Resume Next". This causes all the problems. If there is any error this statement will bypass it. So remove this statement and check what happens.

If the problem persists let me know.

Good Luck
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now