Solved

Using a form to capture data on my website

Posted on 2006-11-14
5
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
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…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

632 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