|
ae4444 -> please help with the simplest problem (3/21/2007 9:20:16)
|
Hello there -- Hoping someone can help fix a very simple, seemingly silly problem. I want to set up an FrontPage form and have it deliver the responses to a database. All very straightforward one might think. So, first step - I've created the form, renamed the HTML file to ASP - and with the default setting of 'send to filename' under form properties the form displays as it shouldin IE6. No problem with the form then. A problem only occurs when I go back to form properties, change it to 'send to database', create the database, set the results table etc and then preview the form -- at which point the form doesn't display as it should. What is displayed is the following code: ==================== <% ' 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 Session.LCID = 1033 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("index_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(7) Dim arFormDBFields0(7) Dim arFormValues0(7) arFormFields0(0) = "Contact_Organization" arFormDBFields0(0) = "Contact_Organization" arFormValues0(0) = Request("Contact_Organization") arFormFields0(1) = "Contact_Title" arFormDBFields0(1) = "Contact_Title" arFormValues0(1) = Request("Contact_Title") arFormFields0(2) = "Contact_FullName" arFormDBFields0(2) = "Contact_FullName" arFormValues0(2) = Request("Contact_FullName") arFormFields0(3) = "Contact_Email" arFormDBFields0(3) = "Contact_Email" arFormValues0(3) = Request("Contact_Email") arFormFields0(4) = "Contact_FAX" arFormDBFields0(4) = "Contact_FAX" arFormValues0(4) = Request("Contact_FAX") arFormFields0(5) = "Contact_WorkPhone" arFormDBFields0(5) = "Contact_WorkPhone" arFormValues0(5) = Request("Contact_WorkPhone") arFormFields0(6) = "Contact_URL" arFormDBFields0(6) = "Contact_URL" arFormValues0(6) = Request("Contact_URL") 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 FP_FormConfirmation "text/html; charset=windows-1252",_ "Form Confirmation",_ "Thank you for submitting the following information:",_ "index.asp",_ "Return to the form." 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"> <meta http-equiv="Content-Language" content="en-us"> <TITLE>New Page 2</TITLE> </HEAD> <BODY> <H1>New Page 2</H1> <HR> <P> This is an explanation of the purpose of the form ...</P> <FORM METHOD="POST" ACTION="index.asp" webbot-action="--WEBBOT-SELF--"> <!--WEBBOT BOT=SaveDatabase SuggestedExt="asp" S-DataConnection="index" S-RecordSource="Results" U-Database-URL="fpdb/index.mdb" 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="Contact_Organization Contact_Title Contact_FullName Contact_Email Contact_FAX Contact_WorkPhone Contact_URL" S-Form-DBFields="Contact_Organization Contact_Title Contact_FullName Contact_Email Contact_FAX Contact_WorkPhone Contact_URL" U-ASP-Include-Url="_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="40548" endspan --><P> Please provide the following contact information:</P> <BLOCKQUOTE> <TABLE> <TR> <TD ALIGN="right"> <EM>Name</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_FullName" SIZE=35> </TD> </TR> <TR> <TD ALIGN="right"> <EM>Title</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_Title" SIZE=35> </TD> </TR> <TR> <TD ALIGN="right"> <EM>Organization</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_Organization" SIZE=35> </TD> </TR> <TR> <TD ALIGN="right"> <EM>Work Phone</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_WorkPhone" SIZE=25 MAXLENGTH=25> </TD> </TR> <TR> <TD ALIGN="right"> <EM>FAX</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_FAX" SIZE=25 MAXLENGTH=25> </TD> </TR> <TR> <TD ALIGN="right"> <EM>E-mail</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_Email" SIZE=25> </TD> </TR> <TR> <TD ALIGN="right"> <EM>URL</EM></TD> <TD> <INPUT TYPE=TEXT NAME="Contact_URL" SIZE=25 MAXLENGTH=25> </TD> </TR> </TABLE> </BLOCKQUOTE> <INPUT TYPE=SUBMIT VALUE="Submit Form"> <INPUT TYPE=RESET VALUE="Reset Form"> </FORM> <HR> <H5> Author information goes here.<br>Copyright © 2003 [OrganizationName]. All rights reserved. <BR> Revised: <!--WEBBOT BOT=TimeStamp S-Type="EDITED" S-Format="%m/%d/%y" startspan -->03/21/07<!--webbot bot="TimeStamp" i-checksum="13138" endspan --></H5> </BODY> </HTML> ==================== It's that simple - the form's fine, but it won't display correctly when I set it to send to a database!? The same problem occurs whether I view it on my PC or upload it to the web server. Any ideas? Thanks ahead
|
|
|
|