Frontpage data-driven website doesn't give any errors, but doesn't work I created a website using Frontpage that updates form inputs to an Access database. The site is hosted on a non-local IIS server. I used Frontpage 2003 with Access 2003, and the server uses Windows 2000 Server.
I finally got it to work, but there's something that's vexed me immensely.
For a long time, when I pressed submit, I'd get the confirmation page, but the database wouldn't get updated with form inputs.
Why was I getting the confirmation page instead of getting some error? In fact, I have never gotten an error while using this website (even when it wasn't working). Have I suppressed the errors inadvertently?
****EDIT**** There's a whole bunch of "On Error resume next" commands in my Global.asa file. I'm guessing the ignorance of errors has something to do with that. So then my question would be, who put those commands there, what are they good for, and how do I get rid of them?
I'm including most of the scripting part of my global.asa file below
--------------------------------------------------------------------------------------
<%
' 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("default_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(35)
Dim arFormDBFields0(35)
Dim arFormValues0(35)
arFormFields0(0) = "T2"
arFormDBFields0(0) = "T2"
arFormValues0(0) = Request("T2")
-
-
-
-
-
-
-
arFormDBFields0(34) = "S12"
arFormValues0(34) = Request("S12")
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
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name"
End If
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
Session("FP_SavedFields")=arFormFields0
Session("FP_SavedValues")=arFormValues0
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
Response.Redirect "thankyou.asp"
End If
End If
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>NMU Online Education Survey</title>
</head>
<body>
<form method="POST" action="default.asp" onSubmit="" webbot-action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" startspan SuggestedExt="asp" S-DataConnection="default" S-RecordSource="Results" U-Confirmation-Url="thankyou.asp" S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp REMOTE_USER" S-Builtin-DBFields="Remote_computer_name Browser_type Timestamp User_name" S-Form-Fields="T2 R14 S1 R1 T3 R15 S2 T4 R2 S3 T5 R3 S4 T6 R4 S5 T7 R5 S6 T8 R6 S7 R7 S8 R8 S9 R9 R10 R11 S10 R12 S11 T1 R13 S12" S-Form-DBFields="T2 R14 S1 R1 T3 R15 S2 T4 R2 S3 T5 R3 S4 T6 R4 S5 T7 R5 S6 T8 R6 S7 R7 S8 R8 S9 R9 R10 R11 S10 R12 S11 T1 R13 S12" U-ASP-Include-Url="_fpclass/fpdbform.inc" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="40548" -->
-
-
-
-
-
Last edited by chickenwings : 21-Aug-2007 08:44 AM.
|