[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Why doesn't DW Delete Row in Database Table?

Asked by pborregg in Active Server Pages (ASP)

Tags: Dreamweaver, delete row

I have DW Generated code that is SUPPOSED to delete a record in a table. See Below.

I get an error that says:

Either EOF or BOF or record has been deleted when it clearly hasn't.

Has anyone seen this happen or have had problems deleting records from tables using DW generated code in VB Script ASP Classic pages?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/VBWebProject.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  'MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
  MM_editAction = MM_editAction
End If
 
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' *** Delete Record: construct a sql delete statement and execute it
 
If (CStr(Request("MM_delete")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
 
  If (Not MM_abortEdit) Then
    ' execute the delete
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_VBWebProject_STRING
    MM_editCmd.CommandText = "DELETE FROM dbo.documents WHERE recordid = ?"
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 5, 1, -1, Request.Form("MM_recordId")) ' adDouble
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
  End If
 
End If
%>
<%
Dim docs__MM_recID
docs__MM_recID = "120"
If (Request.QueryString("recID") <> "") Then 
  docs__MM_recID = Request.QueryString("recID")
End If
%>
<%
Dim docs
Dim docs_cmd
Dim docs_numRows
 
Set docs_cmd = Server.CreateObject ("ADODB.Command")
docs_cmd.ActiveConnection = MM_VBWebProject_STRING
docs_cmd.CommandText = "select * from documents where recordid = ?" 
docs_cmd.Prepared = true
docs_cmd.Parameters.Append docs_cmd.CreateParameter("param1", 5, 1, -1, docs__MM_recID) ' adDouble
 
Set docs = docs_cmd.Execute
docs_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form ACTION="<%=MM_editAction%>" METHOD="POST" id="form1" name="form1">
<input name="goBack" type="button" class="small" onclick="location.href='list-subproject-items.asp?pid=<%= Session("SV_PID") %>'" value="Return to Project Detail" />
<input type="hidden" name="MM_delete" value="form1" />
<input type="hidden" name="MM_recordId" value="<%= docs.Fields.Item("recordid").Value %>" />
</form>
</body>
</html>
<%
docs.Close()
Set docs = Nothing
%>
[+][-]12/22/08 05:50 PM, ID: 23230987Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12/22/08 06:37 PM, ID: 23231110Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/23/08 06:16 AM, ID: 23233630Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/23/08 08:45 AM, ID: 23234768Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12/23/08 08:46 AM, ID: 23234778Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/23/08 04:24 PM, ID: 23237889Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12/25/08 06:14 PM, ID: 23244205Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/25/08 07:01 PM, ID: 23244251Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Active Server Pages (ASP)
Tags: Dreamweaver, delete row
Sign Up Now!
Solution Provided By: pborregg
Participating Experts: 3
Solution Grade: A
 
[+][-]12/26/08 04:12 PM, ID: 23246921Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625