navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Form Update to DB Problem???

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Form Update to DB Problem???
Page: [1]
 
Bnugent

 

Posts: 257
From: Tampa Florida Tampa, FL USA
Status: offline

 
Form Update to DB Problem??? - 10/24/2007 15:35:48   
I had to re-create a form, that I created many moons ago, and it seems to process, I am able to get confirmation fields, but for some reason, its not updating in the DB?

Here is my code? Can anyone figure this one out? Its driving me nuts?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>----Jim Harte's 27th Annual MSC Soccer Camps- HOME----</title>

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link href="newsite/style.css" rel="stylesheet" type="text/css">
</head>

<body link="#000000" vlink="#000000" alink="#000000">
<table cellspacing="0" cellpadding="0" align="center">
<tr>
<td style="height:766px">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="width:50%;">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="height:305px; background:url('images/new_site/bg2-flip.jpg') right; "></td>
</tr>
<tr>
<td style=" background:#CAC39F url('images/new_site/bg-mid.gif') repeat-x top; "></td>
</tr>
</table>
</td>
<td style="width:766px;">
<table style="width:766px;" cellspacing="0" cellpadding="0">
<tr>
<td style="height:305px; background:url('images/new_site/bg2.jpg') no-repeat; ">
<div ><a href="newsite/indexold.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r1','','images/new_site/l1-1.jpg',1)">
<img alt="" src="images/new_site/l1-1.jpg" name="r1"></a><a href="newsite/index-1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r2','','images/new_site/l2-2.jpg',1)"><img src="images/new_site/l2.jpg" name="r2"></a><a href="newsite/index-2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r3','','images/new_site/l3-3.jpg',1)"><img alt="" src="images/new_site/l3.jpg" name="r3"></a><a href="newsite/index-3.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r4','','images/new_site/l4-4.jpg',1)"><img alt="" src="images/new_site/l4.jpg" name="r4"></a><a href="newsite/index-4.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r5','','images/new_site/l5-5.jpg',1)"><img alt="" src="images/new_site/l5.jpg" name="r5"></a><a href="newsite/index-5.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r6','','images/new_site/l6-6.jpg',1)"><img alt="" src="images/new_site/l6.jpg" name="r6"></a><a href="newsite/index-6.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r7','','images/new_site/l7-7.jpg',1)"><img alt="" src="images/new_site/l7.jpg" name="r7"></a><a href="newsite/index-7.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('r8','','images/new_site/l8-8.jpg',1)"><img alt="" src="images/new_site/l8.jpg" name="r8"></a></div>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><b><font size="5" color="#FFFFFF">
JIM HARTE'S 27th ANNUAL MSC SOCCER CAMPS</font></b></td>
</tr>
<tr>
<td style="height:461px; background:#CAC39F url('images/new_site/bg-mid.gif') repeat-x top; ">
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td style="width:438%;">
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="NewCamperEntryForm1" S-RecordSource="OnlineReg" U-Database-URL="fpdb/NewCamperEntryForm1.mdb" U-Confirmation-Url="Maint/Online_Reg/Online_Reg_FormConfirmation.asp" S-Builtin-Fields="HTTP_USER_AGENT REMOTE_HOST Timestamp REMOTE_USER" S-Builtin-DBFields="Browser_type Remote_computer_name Timestamp User_name" S-Form-Fields="session1 expmonth creditcardchecknumber parentphone parentname pass fax Active email last emergencycontact phone address1 paymenttype zip first age city state emergencycontactnumber" S-Form-DBFields="session1 expmonth creditcardchecknumber parentphone parentname pass fax active email last emergencycontact phone address1 paymenttype zip first age city state emergencycontactnumber" --><p align="center">
Please Select a Camp:<select size="1" name="Active">
<option value="2007 Winter GCU">Winter Holiday @ Belleair Rec Center (GCU)
</option>
</select><br>
<b>CAMPER INFORMATION</b><br>
Campers First Name: <b>
<!--webbot bot="Validation" s-data-type="String" b-value-required="TRUE" --><input type="text" name="first" size="20" tabindex="1"></b> 
Campers Last Name: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="last" size="20"></b><br>
Enter Campers Age: <b> <select size="1" name="age">
<option value="6 ">6 </option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10" selected>10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
</select></b><br>
Select a Password: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input name="pass" size="20"> </b>
Campers/Parent's Email:  <b>
<!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="7" i-maximum-length="40" --><input type="text" name="email" size="20" maxlength="40"></b><br>
<b><br>
CAMPER/PARENT CONTACT INFORMATION<br>
</b>Campers Address: <b>  <!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="address1" size="20"></b>
Campers City: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="city" size="20">  </b>
Campers State: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><select size="1" name="state">
<option value="FL">FL</option>
<option value="AL">AL</option>
<option value="AK">AK</option>
<option value="AZ">AZ</option>
<option value="AR">AR</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
<option value="DE">DE</option>
<option value="DC">DC</option>
<option value="GA">GA</option>
<option value="HI">HI</option>
<option value="IL">IL</option>
<option value="IN">IN</option>
<option value="IA">IA</option>
<option value="KS">KS</option>
<option value="KY">KY</option>
<option value="LA">LA</option>
<option value="ME">ME</option>
<option value="MD">MD</option>
<option value="MA">MA</option>
<option value="MI">MI</option>
<option value="MN">MN</option>
<option value="MS">MS</option>
<option value="MO">MO</option>
<option value="MT">MT</option>
<option value="NE">NE</option>
<option value="NV">NV</option>
<option value="NH">NH</option>
<option value="NJ">NJ</option>
<option value="NM">NM</option>
<option value="NY">NY</option>
<option value="NC">NC</option>
<option value="ND">ND</option>
<option value="OH">OH</option>
<option value="OK">OK</option>
<option value="OR">OR</option>
<option value="PA">PA</option>
<option value="RI">RI</option>
<option value="SC">SC</option>
<option value="SD">SD</option>
<option value="TN">TN</option>
<option value="TX">TX</option>
<option value="UT">UT</option>
<option value="VT">VT</option>
<option value="VA">VA</option>
<option value="WA">WA</option>
<option value="WV">WV</option>
<option value="WI">WI</option>
<option value="WY">WY</option>
</select>  </b>Campers Zip: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="zip" size="16"></b><br>
Camper Home Phone Number:<b><!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="phone" size="20"> </b>
Campers Fax: <b> <input type="text" name="fax" size="20" value="No Fax"></b>
<br>
Parents Name(first & Last):   <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="parentname" size="20"> </b>
Parents Work/Cell: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="parentphone" size="13"><br>
</b>Emergency Contact Name:<b>    
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="emergencycontact" size="20">  </b>
Emer. Contact #: <b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="emergencycontactnumber" size="15"></b></p>
<p align="center"><b>PLEASE SELECT
YOUR SESSION<br>
Session # 1   (morning camp)   
December 26th- December 29th 
8:30 - 12:00      
$95      </b> <select size="1" name="session1">
<option selected value="0">No</option>
<option value="95.00">Attend</option>
</select><br>
<b>Session # 2 (afternoon camp)  
December 26th- December 29th 
8:30 - 12:00      
$95      </b> <select size="1" name="D1">
<option selected value="0">No</option>
<option value="95.00">Attend</option>
</select></p>
<p align="center"><b>PAYMENT
INFORMATION:<br>
Payment Type: </b><select size="1" name="paymenttype">
<option value="Visa">Visa</option>
<option value="MC">MasterCard</option>
<option value="AMEX">AMEX</option>
<option value="Discover">Discover</option>
</select><b>     <br>
Card Number: </b>
<!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="12" --><input type="text" name="creditcardchecknumber" size="30" value="Do Not Enter Dashes or Spaces"><b>
(Do Not Enter Dashes or Spaces) 
Exp Date: </b>
<!--webbot bot="Validation" b-value-required="TRUE" --><input type="text" name="expmonth" size="5"><b>
(MM/YY)<br>
<br>
Please read the terms of this
transaction.  You must Select the "I
Agree" box for your registration to be
submitted.</b></p>
<div>
<p align="center">I authorize
Marauder Soccer Camp, Inc. to charge
my above referenced credit card for
camp tuition.<br>
<br>
I understand that my card will not
be charged until such time as my
placement in camp is guaranteed. </p>
<p align="center">I understand that
full payment for camp registration
will be charged to my credit card.</p>
<p align="center">I understand that
online registration alone does not
guarantee a spot in camp.  I must
fax (813-792-1827) or mail (P.O. Box
15221  Clearwater, FL  33766) to MSC,
Inc a completed and signed EMERGENCY
INFORMATION SHEET to complete the
registration process.  An EMERGENCY
INFORMATION SHEET will be available
for download at the end of this
process.<br>
If you have any questions regarding
online registration, please call us
at 727-786-3589.</div>
<p align="center"><b>I HAVE READ AND
<!--webbot bot="Validation" s-display-name="Agree" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="D2">
<option selected value="Choose One">Select One</option>
<option value="Agree">Agree</option>
</select> TO THE TERMS AND CONDITIONS AS OUTLINED ABOVE.<br>
</b><br>
<input type="submit" value="Submit" name="B1"></p>
</form>
</td>
</tr>
</table>
<p><br>
</td>
<td style="width:1%;">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="height:49px"></td>
</tr>
<tr>
<td style=" background:url('images/new_site/bg-line.gif') repeat-y; "></td>
</tr>
<tr>
<td style="height:36px"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td style="width:50%;">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="height:305px; background:url('images/new_site/bg3.jpg') left; "></td>
</tr>
<tr>
<td style=" background:#CAC39F url('images/new_site/bg-mid.gif') repeat-x top; "></td>
</tr>
</table>
<p> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td style=" background:#202020 url('images/new_site/bg-bot.gif') repeat-x top; " align="center">
<table style="width:766px;height:62px" cellspacing="0" cellpadding="0">
<tr>
<td >
<div class="c_text" style="width:767; height:31; margin-left:0px; margin-right:0px; margin-top:5px; margin-bottom:5px">
<p align="center"><b><font color="#FFFFFF">JIM HARTE'S MSC SOCCER CAMPS<br>
P.O. Box 15221   Clearwater, FL 33766-5221<br>
Phone: 727-786-3589   Fax: 813-792-1827<br>
Email: </font>
<a href="mailto:coach@msccamp.com" style="text-decoration: none">
<font color="#FFFFFF">msccamp@aol.com</font></a></b></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

_____________________________

Brian---
Bnugent

 

Posts: 257
From: Tampa Florida Tampa, FL USA
Status: offline

 
RE: Form Update to DB Problem??? - 10/24/2007 15:48:23   
upon further review (football joke) it looks like the only difference (aside from the layout) between the original page that worked for 4 years and this is the following code is not on the new page. Its at the very top of the old page and not on the new page. Any idea why?

<%
' 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("NewCamperEntryForm1_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "OnlineReg", 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(26)
Dim arFormDBFields0(26)
Dim arFormValues0(26)

arFormFields0(0) = "session1"
arFormDBFields0(0) = "session1"
arFormValues0(0) = Request("session1")
arFormFields0(1) = "tshirt"
arFormDBFields0(1) = "tshirt"
arFormValues0(1) = Request("tshirt")
arFormFields0(2) = "expmonth"
arFormDBFields0(2) = "expmonth"
arFormValues0(2) = Request("expmonth")
arFormFields0(3) = "session2"
arFormDBFields0(3) = "session2"
arFormValues0(3) = Request("session2")
arFormFields0(4) = "creditcardchecknumber"
arFormDBFields0(4) = "creditcardchecknumber"
arFormValues0(4) = Request("creditcardchecknumber")
arFormFields0(5) = "session3"
arFormDBFields0(5) = "session3"
arFormValues0(5) = Request("session3")
arFormFields0(6) = "parentphone"
arFormDBFields0(6) = "parentphone"
arFormValues0(6) = Request("parentphone")
arFormFields0(7) = "parentname"
arFormDBFields0(7) = "parentname"
arFormValues0(7) = Request("parentname")
arFormFields0(8) = "pass"
arFormDBFields0(8) = "pass"
arFormValues0(8) = Request("pass")
arFormFields0(9) = "session4"
arFormDBFields0(9) = "session4"
arFormValues0(9) = Request("session4")
arFormFields0(10) = "session5"
arFormDBFields0(10) = "session5"
arFormValues0(10) = Request("session5")
arFormFields0(11) = "session6"
arFormDBFields0(11) = "session6"
arFormValues0(11) = Request("session6")
arFormFields0(12) = "fax"
arFormDBFields0(12) = "fax"
arFormValues0(12) = Request("fax")
arFormFields0(13) = "Active"
arFormDBFields0(13) = "active"
arFormValues0(13) = Request("Active")
arFormFields0(14) = "emergencycontact"
arFormDBFields0(14) = "emergencycontact"
arFormValues0(14) = Request("emergencycontact")
arFormFields0(15) = "email"
arFormDBFields0(15) = "email"
arFormValues0(15) = Request("email")
arFormFields0(16) = "last"
arFormDBFields0(16) = "last"
arFormValues0(16) = Request("last")
arFormFields0(17) = "phone"
arFormDBFields0(17) = "phone"
arFormValues0(17) = Request("phone")
arFormFields0(18) = "address1"
arFormDBFields0(18) = "address1"
arFormValues0(18) = Request("address1")
arFormFields0(19) = "paymenttype"
arFormDBFields0(19) = "paymenttype"
arFormValues0(19) = Request("paymenttype")
arFormFields0(20) = "zip"
arFormDBFields0(20) = "zip"
arFormValues0(20) = Request("zip")
arFormFields0(21) = "age"
arFormDBFields0(21) = "age"
arFormValues0(21) = Request("age")
arFormFields0(22) = "first"
arFormDBFields0(22) = "first"
arFormValues0(22) = Request("first")
arFormFields0(23) = "city"
arFormDBFields0(23) = "city"
arFormValues0(23) = Request("city")
arFormFields0(24) = "state"
arFormDBFields0(24) = "state"
arFormValues0(24) = Request("state")
arFormFields0(25) = "emergencycontactnumber"
arFormDBFields0(25) = "emergencycontactnumber"
arFormValues0(25) = Request("emergencycontactnumber")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
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"
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 "Online_Reg_FormConfirmation.asp"

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>


_____________________________

Brian---

(in reply to Bnugent)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Form Update to DB Problem???
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts