Can't get update query to work (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


raksha -> Can't get update query to work (4/27/2007 16:25:26)

I have a form where updates are made. When going to update statement I get this error:
Database Results Wizard Error
The operation failed. If this continues, please contact your server administrator.

A response.write indicates all values are being passed.


The form code is:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>AdultID</title>
</head>

<body>

<!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM AdultList WHERE (AdultID =  ::AdultID::)"
fp_sDefault="AdultID="
fp_sNoRecords=""
fp_sDataConn="Database3"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&AdultID=3&FirstName=202&MiddleName=202&LastName=202&GroupName=202&Notes=203&CouncilID=5&RecdDate=202&PRCDate=202&References=202&Interview=202&Application=202&AreaIDMain=5&Address=202&City=202&Action=202&MMSActive=11&Renewal=11&New=11&"
fp_iDisplayCols=19
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<form METHOD="POST" action="UpdateScreen4.asp">
	<table BORDER="0">
		<tr>
			<td><b>Adult ID:</b></td>
			<td>
<input TYPE="TEXT" NAME="AdultID" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"AdultID")%>"></td>
		</tr>
		<tr>
			<td><b>First Name:</b></td>
			<td>
			<input TYPE="TEXT" NAME="FirstName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"FirstName")%>"></td>
		</tr>
		<tr>
			<td><b>Middle Name:</b></td>
			<td>
			<input TYPE="TEXT" NAME="MiddleName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"MiddleName")%>"></td>
		</tr>
		<tr>
			<td><b>Last Name:</b></td>
			<td>
			<input TYPE="TEXT" NAME="LastName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"LastName")%>"></td>
		</tr>
		<tr>
			<td><b>Group Name:</b></td>
			<td>
			<input TYPE="TEXT" NAME="GroupName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"GroupName")%>"></td>
		</tr>
		<tr>
			<td><b>Notes:</b></td>
			<td>
			<input TYPE="TEXT" NAME="Notes" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Notes")%>"></td>
		</tr>
		<tr>
			<td><b>Council ID:</b></td>
			<td>
			<input TYPE="TEXT" NAME="CouncilID" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"CouncilID")%>"></td>
		</tr>
		<tr>
			<td><b>Recd Date:</b></td>
			<td>
			<input TYPE="TEXT" NAME="RecdDate" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"RecdDate")%>"></td>
		</tr>
		<tr>
			<td><b>PRC Date:</b></td>
			<td>
			<input TYPE="TEXT" NAME="PRCDate" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"PRCDate")%>"></td>
		</tr>
		<tr>
			<td><b>References:</b></td>
			<td>
			<input TYPE="TEXT" NAME="References" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"References")%>"></td>
		</tr>
		<tr>
			<td><b>Interview:</b></td>
			<td>
			<input TYPE="TEXT" NAME="Interview" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Interview")%>"></td>
		</tr>
		<tr>
			<td><b>Application:</b></td>
			<td>
			<input TYPE="TEXT" NAME="Application" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Application")%>"></td>
		</tr>
		<tr>
			<td><b>Area ID Main:</b></td>
			<td>
			<input TYPE="TEXT" NAME="AreaIDMain" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"AreaIDMain")%>"></td>
		</tr>
		<tr>
			<td><b>Address:</b></td>
			<td>
			<input TYPE="TEXT" NAME="Address" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Address")%>"></td>
		</tr>
		<tr>
			<td><b>City:</b></td>
			<td>
			<input TYPE="TEXT" NAME="City" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"City")%>"></td>
		</tr>
		<tr>
			<td><b>Action:</b></td>
			<td>
			<input TYPE="TEXT" NAME="Action" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Action")%>"></td>
		</tr>
		<tr>
			<td><b>MMS Active:</b></td>
			<td>
			<input TYPE="TEXT" NAME="MMSActive" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"MMSActive")%>"></td>
		</tr>
		<tr>
			<td><b>Renewal:</b></td>
			<td>
			<input TYPE="TEXT" NAME="Renewal" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"Renewal")%>"></td>
		</tr>
		<tr>
			<td><b>New:</b></td>
			<td>
			<input TYPE="TEXT" NAME="New" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"New")%>"></td>
		</tr>
		<tr>
			<td COLSPAN="2"><br>
			<input TYPE="Submit" NAME="fp_submit"></td>
		</tr>
	</table>
</form>
<hr>
<input TYPE="hidden" NAME="AdultID" SIZE="5" VALUE="<%=FP_FieldVal(fp_rs,"AdultID")%>"></td>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->

</body>

</html>


Update code is:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<table>
	<tbody>
		<!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="UPDATE AdultList SET FirstName = ' " & Request.Form("FirstName") & " ', MiddleName = ' " & Request.Form("MiddleName") & " ', LastName = ' " & Request.Form("LastName") & " ', GroupName = ' " & Request.Form("GroupName") & " ', Notes = ' " & Request.Form("Notes") & " ', CouncilID = " & Request.Form("CouncilID") & ", RecdDate = ' " & Request.Form("RecdDate") & " ', PRCDate = ' " & Request.Form("PRCDate") & " ', References = ' " & Request.Form("References") & " ', Interview = ' " & Request.Form("Interview") & " ', Application = ' " & Request.Form("Application") & " ', AreaIDMain = " & Request.Form("AreaIDMain") & ", Address = ' " & Request.Form("Address") & " ', City = ' " & Request.Form("City") & " ', Action = ' " & Request.Form("Action") & " ', MMSActive = " & Request.Form("MMSActive") & ", Renewal = " & Request.Form("Renewal") & ", New = " & Request.Form("New") & " WHERE AdultID = "&Request.Form("AdultID")&" "
fp_sDefault="AdultID="
fp_sNoRecords="<tr><td colspan=19 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="Database3"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&AdultID=3&FirstName=202&MiddleName=202&LastName=202&GroupName=202&Notes=203&CouncilID=5&RecdDate=202&PRCDate=202&References=202&Interview=202&Application=202&AreaIDMain=5&Address=202&City=202&Action=202&MMSActive=11&Renewal=11&New=11&"
fp_iDisplayCols=19
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>


<!--#include file="../_fpclass/fpdbrgn1.inc"-->
		<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>

</body>

</html>

Any ideas?




Spooky -> RE: Can't get update query to work (4/27/2007 16:30:06)

Try these 2 posts

First :
http://www.frontpagewebmaster.com/m-175524/tm.htm

Then check for reserved words :
http://www.frontpagewebmaster.com/m-44111/tm.htm




raksha -> RE: Can't get update query to work (4/27/2007 17:01:24)

Thanks Spooky! I had 4 reserved words - changed them all and it works




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
8.007813E-02