navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
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

 

Add a checkbox to the DRW to Delete

 
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 >> Add a checkbox to the DRW to Delete
Page: [1]
 
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
Add a checkbox to the DRW to Delete - 1/31/2006 17:26:09   
This is a new thread form a previous session as follows:
http://www.frontpagewebmaster.com/m-89415/tm.htm

I have been trying to resolve why when using the DRW for deleting records in a Database that when I select a custom query the fields are no longer available. See previous thread.

Here is the new Diet ASP code I just finished:
-----------------------------------------------------
<html>

<head>

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

<body>

<form method="POST" action="test.asp">
	<table width="100%" border="1">
		<thead>
			<tr>
				<th ALIGN="LEFT">Del.</th>
				<th ALIGN="LEFT"><b>ID</b></th>
				<th ALIGN="LEFT"><b>Fname</b></th>
				<th ALIGN="LEFT"><b>LName</b></th>
				<th ALIGN="LEFT"><b>Company</b></th>
				<th ALIGN="LEFT"><b>CNum</b></th>
				<th ALIGN="LEFT"><b>AltPh</b></th>
				<th ALIGN="LEFT"><b>Addr1</b></th>
				<th ALIGN="LEFT"><b>City</b></th>
				<th ALIGN="LEFT"><b>SorP</b></th>
				<th ALIGN="LEFT"><b>PostCode</b></th>
				<th ALIGN="LEFT"><b>Country</b></th>
				<th ALIGN="LEFT"><b>EmailAddr</b></th>
				<th ALIGN="LEFT"><b>BillMe</b></th>
				<th ALIGN="LEFT"><b>CCType</b></th>
				<th ALIGN="LEFT"><b>CCNumber</b></th>
				<th ALIGN="LEFT"><b>CCExpMM</b></th>
				<th ALIGN="LEFT"><b>CCExpYY</b></th>
				<th ALIGN="LEFT"><b>CCAuth</b></th>
				<th ALIGN="LEFT"><b>SelectedEdition</b></th>
				<th ALIGN="LEFT"><b>BTBEds</b></th>
				<th ALIGN="LEFT"><b>BEdsBrd</b></th>
				<th ALIGN="LEFT"><b>CenLinBEds</b></th>
				<th ALIGN="LEFT"><b>CenLinHLTBEds</b></th>
				<th ALIGN="LEFT"><b>LCBT</b></th>
				<th ALIGN="LEFT"><b>LCBrd</b></th>
				<th ALIGN="LEFT"><b>LCCenLin</b></th>
				<th ALIGN="LEFT"><b>LCCenLinHLT</b></th>
				<th ALIGN="LEFT"><b>ExCombRate</b></th>
				<th ALIGN="LEFT"><b>NumWkRun</b></th>
				<th ALIGN="LEFT"><b>category</b></th>
				<th ALIGN="LEFT"><b>AdDescr</b></th>
				<th ALIGN="LEFT"><b>wordCount</b></th>
				<th ALIGN="LEFT"><b>Remote_computer_name</b></th>
				<th ALIGN="LEFT"><b>User_name</b></th>
				<th ALIGN="LEFT"><b>Browser_type</b></th>
				<th ALIGN="LEFT"><b>Timestamp</b></th>
				<th ALIGN="LEFT"><b>EditOrder</b></th>
			</tr>
		</thead>
		<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="SELECT * FROM ClassifiedAdEntry "
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=37 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="ClassAds"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&Fname=200&LName=200&Company=200&CNum=200&AltPh=200&Addr1=200&City=200&SorP=200&PostCode=200&Country=200&EmailAddr=200&BillMe=200&CCType=200&CCNumber=200&CCExpMM=200&CCExpYY=200&CCAuth=200&SelectedEdition=200&BTBEds=200&BEdsBrd=200&CenLinBEds=200&CenLinHLTBEds=200&LCBT=200&LCBrd=200&LCCenLin=200&LCCenLinHLT=200&ExCombRate=200&NumWkRun=200&category=200&AdDescr=200&wordCount=3&Remote_computer_name=200&User_name=200&Browser_type=200&Timestamp=135&EditOrder=200&"
fp_iDisplayCols=37
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="43114" --><tr>
				<td>
				<input type="checkbox" name="ID" value="<% = FP_Field(fp_rs,"ID")%>"></td>
				<td>
				<%=FP_FieldVal(fp_rs,"ID")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Fname")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LName")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Company")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CNum")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"AltPh")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Addr1")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"City")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"SorP")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"PostCode")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Country")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"EmailAddr")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"BillMe")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCType")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCNumber")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCExpMM")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCExpYY")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCAuth")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"SelectedEdition")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"BTBEds")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"BEdsBrd")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CenLinBEds")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CenLinHLTBEds")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCBT")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCBrd")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCCenLin")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCCenLinHLT")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"ExCombRate")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"NumWkRun")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"category")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"AdDescr")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"wordCount")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Remote_computer_name")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"User_name")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Browser_type")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Timestamp")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"EditOrder")%></td>
			</tr>
			<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</tbody>
	</table>
	<p><b><font color="#FF0000">Select the records to Delete and then click the 
	DELETE below. You may click the Reset if you change your mind and decide to 
	Not Delete the Records.</font></b><br>
	<input type="submit" value="DELETE" name="B1">  <input type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>

-----------------------------------------------------

I have attached screen dumps as they appear with what I have been doing to try and get this to work.

Per the earlier thread, all that is needed is to:
1- Created a DRW
2- Inserted a column to the left
3- Inserted a checkbox
4- Gave the values to the checkbox
5- Created the Delete query

Of course in my case I am using ID not StaffID.




Thumbnail Image
:)

Attachment (1)

< Message edited by BeTheBall -- 1/31/2006 19:10:58 >
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:05:20   
Are you putting your delete query on the same page as the checkboxes or on a second page?

_____________________________

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 FrogMan)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:15:38   
BeTheBall,

On the same page. But I guess I do not understand how to enter the SQL statement in the Custom Query so that the records that are marked to be deleted are SELECTED.

Just having a lot of problems with this. It seems so simple.

I have read throught the other thread and have actually replicated it and still can't get a grasp on this.

I did, at one point, get it to completely wipe out all the records, but don't ask me how, and I would rather be able to delete only SELECTED records.

Thanks for any assistance you can provide.

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:19:07   
By the way, only SELECT queries will return a list of fields in step 3 of the wizard as the list of fields is for you to pick the ones that should be displayed on the page. A delete, update or insert query do not display fields.

_____________________________

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 BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:24:51   
Your custom query is correct. When you submit the form, the id for every record whose box you check will be put in a string, i.e., 1,3,4,7,9. Your query then says go through the records in my table and if the record's ID is in the string, delete it. Does that make sense? When you input the query in step 2, move to step 3 and choose the "More Options" button and there change the "No Records Returned" text to something like, "Record(s) Deleted.". Then you can just click OK on steps 4 and 5. The only problem is with the Delete DRW on the same page the page will try to execute it when it loads and probably throw an error. You might have an easier time if you put the delete portion on a second page, say delete.asp and then have your form submit to that page.

Hope that helps some.

_____________________________

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 BeTheBall)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:26:59   
BeTheBall,

Not sure I get this.

What I am trying to do is use the DRW and when the person goes to the page have it list all the current records in the database. This much I have working 100%.

So, next from earlier posts I thought it would be nice to have a checkbox next to each record and the person could select which records they want to delete, then at the bottom of the page click a button (called delete selected records) and it would delete the records and return the person back to the newly updated page with the records deleted (no longer showing). Conversely, they could click the Delete selected records and it would delete the records and go to another page confirming what they just deleted (not really necessary at this point, but maybe down the road).

The problem seems to be in the Custom Query how to enter the SQL Statement.
I have been at this for two days and seem to be just stepping over how to make it work.

Next I am trying this in the custom query:
DELETE ID FROM ClassifiedAdEntry
WHERE (ID = ::ID::)

But again, no select here so I do not believe it will work.

Ideas?

Thanks

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:30:31   
Read my most recent post, that should clarify.

http://www.frontpagewebmaster.com/fb.asp?m=310409

_____________________________

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 FrogMan)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:31:48   
BeTheBall,

Okay. Thanks.

Here is what I just tried and still the next screen does not show the fields for selecting:
DELETE FROM ClassifiedAdEntry
WHERE (ID = ::ID::)

I'll go check the link now.

Thanks Again. I'll post shortly.

(in reply to BeTheBall)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:45:53   
BeTheBall,

Well, I need to get outta here for today. I will check back tomorrow. Maybe some sleep on this will give me an answer.

It is still not working as I think it should.

THanks for the assist.

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 19:54:15   
I think it is because you are expecting the DRW to do something it won't do. Keep in mind that the delete query deletes entire records, not just certain fields in the record. Therefore, there is no need to specify fields like you do in a SELECT query. Trust me and create a second page and name it delete.asp. Then insert a DRW with the custom query you have been trying. Then go back to the page that shows the records and right-click the form and choose "Form properties". Choose Options and enter delete.asp in the Action box. That should do it. Preview the form in the browser, check a couple of records and click submit. That will take you to delete.asp. Then go back to the page that displays the records and refresh the page. The records you deleted should be gone.

_____________________________

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 FrogMan)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 1/31/2006 20:24:04   
Here is, in my opinion, a quite slick way of doing this. Paste the code exactly as it appears into a new file, save as test2.asp and then test it. Make sure you don't delete a record you really don't want to delete. What I did was create a delete database results region and we are pasting at the very top of the page, even before the <html> tag. We then use an if statement that makes it so the code will not execute until the DELETE button is pressed. When it is pressed the page reloads with the deleted records no longer displayed.

<%If Request.Form("B1") = "DELETE" Then%>
<!--#include file="_fpclass/fpdblib.inc"-->

<%
fp_sQry="DELETE FROM ClassifiedAdEntry WHERE ID IN (::ID::)"
fp_sDefault="IDs="
fp_sNoRecords=""
fp_sDataConn="ClassAds"
fp_iMaxRecords=256
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"-->
<!--#include file="_fpclass/fpdbrgn2.inc"-->
<%End If%>
<html>

<head>

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

<body>

<form method="POST" action="test2.asp">
	<table width="100%" border="1">
		<thead>
			<tr>
				<th ALIGN="LEFT">Del.</th>
				<th ALIGN="LEFT"><b>ID</b></th>
				<th ALIGN="LEFT"><b>Fname</b></th>
				<th ALIGN="LEFT"><b>LName</b></th>
				<th ALIGN="LEFT"><b>Company</b></th>
				<th ALIGN="LEFT"><b>CNum</b></th>
				<th ALIGN="LEFT"><b>AltPh</b></th>
				<th ALIGN="LEFT"><b>Addr1</b></th>
				<th ALIGN="LEFT"><b>City</b></th>
				<th ALIGN="LEFT"><b>SorP</b></th>
				<th ALIGN="LEFT"><b>PostCode</b></th>
				<th ALIGN="LEFT"><b>Country</b></th>
				<th ALIGN="LEFT"><b>EmailAddr</b></th>
				<th ALIGN="LEFT"><b>BillMe</b></th>
				<th ALIGN="LEFT"><b>CCType</b></th>
				<th ALIGN="LEFT"><b>CCNumber</b></th>
				<th ALIGN="LEFT"><b>CCExpMM</b></th>
				<th ALIGN="LEFT"><b>CCExpYY</b></th>
				<th ALIGN="LEFT"><b>CCAuth</b></th>
				<th ALIGN="LEFT"><b>SelectedEdition</b></th>
				<th ALIGN="LEFT"><b>BTBEds</b></th>
				<th ALIGN="LEFT"><b>BEdsBrd</b></th>
				<th ALIGN="LEFT"><b>CenLinBEds</b></th>
				<th ALIGN="LEFT"><b>CenLinHLTBEds</b></th>
				<th ALIGN="LEFT"><b>LCBT</b></th>
				<th ALIGN="LEFT"><b>LCBrd</b></th>
				<th ALIGN="LEFT"><b>LCCenLin</b></th>
				<th ALIGN="LEFT"><b>LCCenLinHLT</b></th>
				<th ALIGN="LEFT"><b>ExCombRate</b></th>
				<th ALIGN="LEFT"><b>NumWkRun</b></th>
				<th ALIGN="LEFT"><b>category</b></th>
				<th ALIGN="LEFT"><b>AdDescr</b></th>
				<th ALIGN="LEFT"><b>wordCount</b></th>
				<th ALIGN="LEFT"><b>Remote_computer_name</b></th>
				<th ALIGN="LEFT"><b>User_name</b></th>
				<th ALIGN="LEFT"><b>Browser_type</b></th>
				<th ALIGN="LEFT"><b>Timestamp</b></th>
				<th ALIGN="LEFT"><b>EditOrder</b></th>
			</tr>
		</thead>
		<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="SELECT * FROM ClassifiedAdEntry "
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=37 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="ClassAds"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&Fname=200&LName=200&Company=200&CNum=200&AltPh=200&Addr1=200&City=200&SorP=200&PostCode=200&Country=200&EmailAddr=200&BillMe=200&CCType=200&CCNumber=200&CCExpMM=200&CCExpYY=200&CCAuth=200&SelectedEdition=200&BTBEds=200&BEdsBrd=200&CenLinBEds=200&CenLinHLTBEds=200&LCBT=200&LCBrd=200&LCCenLin=200&LCCenLinHLT=200&ExCombRate=200&NumWkRun=200&category=200&AdDescr=200&wordCount=3&Remote_computer_name=200&User_name=200&Browser_type=200&Timestamp=135&EditOrder=200&"
fp_iDisplayCols=37
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="43114" --><tr>
				<td>
				<input type="checkbox" name="ID" value="<% = FP_Field(fp_rs,"ID")%>"></td>
				<td>
				<%=FP_FieldVal(fp_rs,"ID")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Fname")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LName")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Company")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CNum")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"AltPh")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Addr1")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"City")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"SorP")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"PostCode")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Country")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"EmailAddr")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"BillMe")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCType")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCNumber")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCExpMM")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCExpYY")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CCAuth")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"SelectedEdition")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"BTBEds")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"BEdsBrd")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CenLinBEds")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"CenLinHLTBEds")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCBT")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCBrd")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCCenLin")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"LCCenLinHLT")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"ExCombRate")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"NumWkRun")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"category")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"AdDescr")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"wordCount")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Remote_computer_name")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"User_name")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Browser_type")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"Timestamp")%></td>
				<td>
				<%=FP_FieldVal(fp_rs,"EditOrder")%></td>
			</tr>
			<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</tbody>
	</table>
	<p><b><font color="#FF0000">Select the records to Delete and then click the 
	DELETE below. You may click the Reset if you change your mind and decide to 
	Not Delete the Records.</font></b><br>
	<input type="submit" value="DELETE" name="B1">  <input type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>


< Message edited by BeTheBall -- 1/31/2006 20:50:15 >


_____________________________

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 BeTheBall)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 11:43:10   
BeTheBall,

Way to go. It works. I am still a little bewildered on the second page being used. Is it because there needs to be an Action for the SQL deletion to work, or is it a matter of having the SELECT records in the first page set so the Action in the second page can occur?

This is really Exciting. Now things can move along and start throwing in a lot of bells and whistles.

Thank you, Thank you.

(in reply to BeTheBall)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 11:47:30   
BeTheBall,

Okay, now on to phase two.

I have copied the code just as it is. Found, though, that I needed to change the
<!--#include file="_fpclass/fpdblib.inc"-->
to
<!--#include file="../../_fpclass/fpdblib.inc"-->
because of the location of the _fpclass folder. No biggy.
Next, I tried it, but I get errors.

I am going to mess around with it for a while this morning because it appears to be a slicker way of handling the deletions. And I am all for less code and bells and whistles.

I'll post later when I have reach that frustration level again, or have it working, either way.

You really know this.
Thanks Again

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 11:50:46   
Wouldn't hurt to post the text of the errors.

_____________________________

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 FrogMan)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 13:21:52   
BeTheBall,

Well, been out messing around with things. Have not been able to get the test2.asp to work. When I access the test2.asp and place a check mark next to a record to delete and then click the delete button at the bottom, it comes back with this error:

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

I will keep messing with it after bit.

Right now I have a fairly decent working app now with the earlier two page solution. I have gone in and reduced the number of columns that display and have specified the width of the database fields that display with the delrec.asp form (renamed the form from DelRecord.asp). It just makes it nicer to look at.

When I open the DelRec.asp and place a check mark on a record to delete (or several) and then click the Delete button at the bottom, it goes to the Delete.asp page and displays No Records Returned. Then I click the Back and see all the records there with check marks in front of the records I just set to delete. Then when I click Refresh the records disappear.

Fairly nice, but I still would like to go the extra step as you have advised and make it where the records disappear on one page with the test2.asp so the person deleting the record(s) does not need to do the Refresh step. Could cause confusion.

I'll check back later

Thanks Again.

(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 13:31:02   
The error you are receiving is due to Frontpage's bad coding of the include files. Read more here:

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

Take this line:

fp_sQry="DELETE FROM ClassifiedAdEntry WHERE ID IN (::ID::)"

and change it to:

fp_sQry="DELETE FROM ClassifiedAdEntry WHERE ID IN ("& Request("ID") &")"

That should get rid of the error for this particular page.

_____________________________

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 FrogMan)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 14:26:37   
BeTheBall,

Well I'll be hooked, gutted and fried.

That did the trick. You are just Damn good at this.

Now that you have got me on the straight and narrow, do you have a recommended reading list so i can get up to better speed on ASP? I ahve been reviewing ASPNet 2.0, but a lot of Hosting Sites do not provide for it yet.

Any Opinions on that?

Hey, I really appreciate your patience in getting this to work so well.
I am still messing around with a number of aestetic items, but at this point I am failry done. Now to write it all up, test the flow, test, test, test. Then I will activate the Spooky Logon system and test, test, test. Then I should be ready to demo it to the paper.

Again, your a life saver.


(in reply to BeTheBall)
BeTheBall

 

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

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 16:20:03   
I learn quite a bit about specific ASP functions at w3schools.com. 4guysfromrolla is also very good. However, all my reading pales in comparison to what I have picked up through asking questions here. Spooky and rdouglass are probably the source for 90% of what I have learned. My recommendation is to keep coding and when you get stuck, post here.

_____________________________

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 FrogMan)
FrogMan

 

Posts: 108
From: Lewiston, Idaho US
Status: offline

 
RE: Add a checkbox to the DRW to Delete - 2/1/2006 19:14:41   
BeTheBall,

Yeh, you are right. Spooky and rdouglas are mighty good at this. I have several books on ASP, but never seem to get the time necessary to read through them. Maybe I just need to stay up later at night.

Yes, I check both those sites quite frequently and have reviewed a lot of code from them. I pick up bits and pieces here and there, but I always seem to be able to get in way over my head. But it is making more sense as time has gone by.

Anyway, Sure appreciate all your help and that last bit of code really makes the difference. I have modified it a bit by reducing down the fields that are displayed, added some menu choices and heading info, but nothing all that major.

Thanks again, and see oyu out here later.

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Add a checkbox to the DRW to Delete
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