Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't find error when deleting (or updating) record in database

Status
Not open for further replies.

maloaupito

Technical User
Jun 28, 2001
21
0
0
US
FP2003,W2KServer, IIS 5 - I made a simple Access DB with 4 fields - ContactID, FN, LN, Email - and can populate the DB with no problem using a frontpage form page and see the results with a results page displaying all data.

I want to focus on the error when deleting a record because even though I have an error with updating, I think fixing the deleting problem will also solve the updating problem. Essentially - deleting a record doesn't work (and neither does updating a record). Once I understand the solution(s) to this problem, then I can fix my real DB.

lists all the values in the DB with a link to delete a record by passing one primarykey to pre-del.asp

In pre-del.asp, the data is displayed for confirmation matching the primarykey sent from default.asp
Clicking the Delete button goes to delete.asp for 2 seconds before refreshing to default.asp (code created by FP DBW is below for delete.asp). When clicking on the Delete button, I get an error message of "Database Results Wizard Error The operation failed. If this continues, please contact your server administrator. " instead of my message of "Record Successfully Deleted".

I don't know where the problem is - any ideas to troubleshoot? asp pages? server problem? I've been going around and around on this one, only to keep banging my head against the "wall". I have a June 1st deadline and don't know where else to turn for help. Anyone????

=======================================
Code for delete.asp

Code:
<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="refresh" content="2;URL=default.asp">
<title>New Page 1</title>
</head>

<body>


<!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="Contacts" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="DELETE FROM Contacts&lt;br&gt;WHERE ContactID= ::ContactID::" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="ContactID=" s-norecordsfound="Done" i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="FALSE" startspan --><!--#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="DELETE FROM Contacts WHERE ContactID= ::ContactID::"
fp_sDefault="ContactID="
fp_sNoRecords="Done"
fp_sDataConn="Contacts"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&"
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="22370" --><hr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" -->


</body>

</html>
========================
Code for pre-del.asp

Code:
<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_LCID = 1033 %>
<meta http-equiv="Content-Language" content="en-us">
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ContactID</title>
</head>

<body>

<p>&nbsp;</p>
<!--webbot bot="DatabaseRegionStart" s-columnnames="ContactID,FN,LN,Email" s-columntypes="3,202,202,202" s-dataconnection="Contacts" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="1" b-makeform="FALSE" s-recordsource="Contacts" s-displaycolumns="ContactID,FN,LN,Email" s-criteria="{ContactID} EQ {ContactID} +" s-order s-sql="SELECT * FROM Contacts WHERE (ContactID =  ::ContactID::)" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="ContactID=" s-norecordsfound="No records returned." i-maxrecords="1" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#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 Contacts WHERE (ContactID =  ::ContactID::)"
fp_sDefault="ContactID="
fp_sNoRecords="No records returned."
fp_sDataConn="Contacts"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ContactID=3&FN=202&LN=202&Email=202&"
fp_iDisplayCols=4
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="4213" --><form method="POST" action="delete.asp">
	<p><b>FN:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ContactID,FN,LN,Email" s-column="FN" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;FN&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"FN")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="63901" --><br>
	<b>LN:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ContactID,FN,LN,Email" s-column="LN" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;LN&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"LN")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="64285" --><br>
	<b>Email:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="ContactID,FN,LN,Email" s-column="Email" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Email&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Email")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="8328" --></p>
	<p><button name="B3" type="submit">Delete</button></p>
	<input type="hidden" name="ContactID" value="<%=FP_FieldURL(fp_rs,"ContactID")%>">
</form>
<p>&nbsp;</p>
<hr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></body></html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top