Solved

Using a form to capture data on my website

Posted on 2006-11-14
5
145 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
5 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 250 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now