?
Solved

Using a form to capture data on my website

Posted on 2006-11-14
5
Medium Priority
?
153 Views
Last Modified: 2013-12-24
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
Comment
Question by:Tomcpt
  • 2
3 Comments
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 17945870
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
 

Author Comment

by:Tomcpt
ID: 17947730
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
 
LVL 16

Accepted Solution

by:
CWS (haripriya) earned 1000 total points
ID: 17953622
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

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question