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

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

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

 

Deleting Records from Access...

 
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 >> Deleting Records from Access...
Page: [1]
 
abdulsamikhan

 

Posts: 105
Joined: 12/23/2003
From: Pakistan
Status: offline

 
Deleting Records from Access... - 2/14/2004 12:35:28   
How can I delete multiple records using DRW of FrontPage2003 and Access Database.
I have already asked this question, and the answer provided me was a tutorial which is only for FP2000 and that is not working in FP2003...


Thanks
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Deleting Records from Access... - 2/14/2004 17:15:48   
What didn't work? What have you tried? What, if any, errors are you getting? The concept should be the same for FP 2003 as it is for FP 2000. Create a form with no fields other than the submit button. Create a table for your results inside the form. Enter a new column in your results and insert a check box with a value of <%=YourIDField%>. Then have the form submit to a second page whereon is a DRW with custom SQL of DELETE * FROM YourTable WHERE YourIDField IN (::YourCheckBoxField::).

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to abdulsamikhan)
Net55

 

Posts: 9
Joined: 2/14/2004
Status: offline

 
RE: Deleting Records from Access... - 2/14/2004 20:40:39   
After (or before) deleting can you add to this, to post the record to an "archive" table?

< Message edited by Net55 -- 2/14/2004 20:55:16 >

(in reply to abdulsamikhan)
abdulsamikhan

 

Posts: 105
Joined: 12/23/2003
From: Pakistan
Status: offline

 
RE: Deleting Records from Access... - 2/15/2004 4:03:47   
I have a Database named: backend.mdb and a table named: funnypix, I want to delete records from funnypix, I've two files named: DeleteForm.asp and delete.asp, below are the source codes of both files...


This is the Output:

Database Results Wizard Error
The operation failed. If this continues, please contact your server administrator.

This is the Query I am using:

DELETE * FROM funnypix WHERE ID IN (::ID::)

Where is CheckBox is placed in the form as guided and named as: ID

Now tell me what should I do? I've created the database in Microsoft Access 2003, if it is the same method then why I am getting the above mentioned error.


delete.asp:

quote:

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' 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>New Page 1</title>
</head>

<body>

<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="dabclub" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="DELETE * FROM funnypix WHERE ID IN (::ID::)" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="ID=" s-norecordsfound="Record Deleted" i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">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.</font></td></tr>" startspan b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="TRUE" --><!--#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 funnypix WHERE ID IN (::ID::)"
fp_sDefault="ID="
fp_sNoRecords="<tr><td colspan=16 align=""LEFT"" width=""100%"">Record Deleted</td></tr>"
fp_sDataConn="dabclub"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
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="40461" --><!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>

</body>

</html>


DeleteForm.asp:

quote:


<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' 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>ID</title>
</head>

<body>

<form method="POST" action="Delete.asp">
<table width="100%" border="1">
<thead>
<tr>
<th ALIGN="LEFT"><b>ID</b></th>
<th ALIGN="LEFT"><b>ImageName</b></th>
<th ALIGN="LEFT"><b>ImageThumb</b></th>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,ImageName,ImageThumb" s-columntypes="3,202,202" s-dataconnection="dabclub" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice="ID" s-menuvalue="ID" b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="funnypix" s-displaycolumns="ID,ImageName,ImageThumb" s-criteria s-order s-sql="SELECT * FROM funnypix" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="Record " i-maxrecords="0" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">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.</font></td></tr>" startspan b-InForm="TRUE" b-UseDotNET="FALSE" CurrentExt sa-InputTypes b-DataGridFormat="FALSE" b-DGridAlternate="TRUE" sa-CritTypes b-WasTableFormat="TRUE" --><!--#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 funnypix"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=3 align=""LEFT"" width=""100%"">Record </td></tr>"
fp_sDataConn="dabclub"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="ID"
fp_sMenuValue="ID"
fp_sColTypes="&ID=3&ImageName=202&ImageThumb=202&"
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="33234" --><tr>
<td>
<input type="checkbox" name="ID" value="<%=ID%>"></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,ImageName,ImageThumb" s-column="ImageName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>ImageName<font size="-1">&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs,"ImageName")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="19315" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,ImageName,ImageThumb" s-column="ImageThumb" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>ImageThumb<font size="-1">&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs,"ImageThumb")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="28832" --></td>
</tr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>
<p> </p>
<p><input type="submit" value="Delete" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>


Waiting for response...

(in reply to Net55)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Deleting Records from Access... - 2/15/2004 12:27:43   
Follow Spooky's advice in this post to see the true error:

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

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to abdulsamikhan)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Deleting Records from Access... - 2/15/2004 13:31:04   
quote:

After (or before) deleting can you add to this, to post the record to an "archive" table?


Net55:

Hmmm. That would be much more difficult. You would have to include hidden fields to capture the values from the fields in the db. You would also have to append the name of the ID field to the hidden fields so as to distinguish one record from another. You would also have to create a quite customized SQL to handle the insert. If this is something you really want to do, I would recommend starting a new thread.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Net55)
abdulsamikhan

 

Posts: 105
Joined: 12/23/2003
From: Pakistan
Status: offline

 
RE: Deleting Records from Access... - 2/16/2004 13:19:26   
After following the Spooky's method:

I've got this:

Database Results Wizard Error
Your page contains a query with user input parameters that could not be resolved.
This could happen if your DatabaseRegionStart webbot has an empty or missing s-columnnames or s-columntypes attributes.
You may need to read Microsoft Knowledge Base Article 817029.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Deleting Records from Access... - 2/16/2004 14:18:19   
Two possible solutions:

1 - Put the code on the Spooky Diet

2 - Follow the instructions in the last post in this topic: http://www.frontpagetalk.com/forums/Frustration_with_Database_Interface_Wizard/m_50766/p_1/tmode_1/smode_1/tm.htm

FP 2003 seems to have a bit of a bug. I think dieting the page will work because the s-columnnames and s-columntypes get deleted in the diet.

Edit - Also, see Spooky's 2nd post in this topic:

http://www.frontpagewebmaster.com/m-182839/tm.htm

Seems, that using the include files from older versions of FP can also alleviate this type of problem.

< Message edited by betheball -- 2/16/2004 18:49:01 >


_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to abdulsamikhan)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Deleting Records from Access...
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