PC Review


Reply
Thread Tools Rate Thread

Delete several dbrecords with check boxes.

 
 
Ted Ljong
Guest
Posts: n/a
 
      25th Oct 2003
FP 2000 and access 2000

In a 2-frame page:
I display records from an accessdb in frame 1. I want to mark 1 or several
records in order to delete them. I mark them with check boxes but I can't
find out how to send the marked records to the delete page.

Is there anyone that can give me a clue.
Ted Ljong


 
Reply With Quote
 
 
 
 
Ted Ljong
Guest
Posts: n/a
 
      25th Oct 2003
I rewrite my question.

How to mark 1 or several records from a dbresult and then transfer the
marked records to another page

Ted

"Ted Ljong" <(E-Mail Removed)> skrev i meddelandet
news:(E-Mail Removed)...
> FP 2000 and access 2000
>
> In a 2-frame page:
> I display records from an accessdb in frame 1. I want to mark 1 or

several
> records in order to delete them. I mark them with check boxes but I can't
> find out how to send the marked records to the delete page.
>
> Is there anyone that can give me a clue.
> Ted Ljong
>
>



 
Reply With Quote
 
Jim Buyens
Guest
Posts: n/a
 
      25th Oct 2003
You would have to custom-program this in ASP or ASP.NET.
If this is within your capabilities, post again to this
thread, stating which approach you prefer.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*


>-----Original Message-----
>FP 2000 and access 2000
>
>In a 2-frame page:
>I display records from an accessdb in frame 1. I want
>to mark 1 or several records in order to delete them. I
>mark them with check boxes but I can't find out how to
>send the marked records to the delete page.
>
>Is there anyone that can give me a clue.
>Ted Ljong
>
>
>.
>

 
Reply With Quote
 
Ted Ljong
Guest
Posts: n/a
 
      25th Oct 2003
Thanks Jim
No that is not in my capabilities,
Ted Ljong
"Jim Buyens" <(E-Mail Removed)> skrev i meddelandet
news:023e01c39b30$9f1736a0$(E-Mail Removed)...
> You would have to custom-program this in ASP or ASP.NET.
> If this is within your capabilities, post again to this
> thread, stating which approach you prefer.
>
> Jim Buyens
> Microsoft FrontPage MVP
> http://www.interlacken.com
> Author of:
> *------------------------------------------------------*
> |\----------------------------------------------------/|
> || Microsoft Office FrontPage 2003 Inside Out ||
> || Microsoft FrontPage Version 2002 Inside Out ||
> || Web Database Development Step by Step .NET Edition ||
> || Troubleshooting Microsoft FrontPage 2002 ||
> || Faster Smarter Beginning Programming ||
> || (All from Microsoft Press) ||
> |/----------------------------------------------------\|
> *------------------------------------------------------*
>
>
> >-----Original Message-----
> >FP 2000 and access 2000
> >
> >In a 2-frame page:
> >I display records from an accessdb in frame 1. I want
> >to mark 1 or several records in order to delete them. I
> >mark them with check boxes but I can't find out how to
> >send the marked records to the delete page.
> >
> >Is there anyone that can give me a clue.
> >Ted Ljong
> >
> >
> >.
> >



 
Reply With Quote
 
Ted Ljong
Guest
Posts: n/a
 
      26th Oct 2003
Hi Jim
Did I misunderstood you? I appreciate some help with ASP
Ted Ljong.
"Jim Buyens" <(E-Mail Removed)> skrev i meddelandet
news:023e01c39b30$9f1736a0$(E-Mail Removed)...
> You would have to custom-program this in ASP or ASP.NET.
> If this is within your capabilities, post again to this
> thread, stating which approach you prefer.
>
> Jim Buyens
> Microsoft FrontPage MVP
> http://www.interlacken.com
> Author of:
> *------------------------------------------------------*
> |\----------------------------------------------------/|
> || Microsoft Office FrontPage 2003 Inside Out ||
> || Microsoft FrontPage Version 2002 Inside Out ||
> || Web Database Development Step by Step .NET Edition ||
> || Troubleshooting Microsoft FrontPage 2002 ||
> || Faster Smarter Beginning Programming ||
> || (All from Microsoft Press) ||
> |/----------------------------------------------------\|
> *------------------------------------------------------*
>
>
> >-----Original Message-----
> >FP 2000 and access 2000
> >
> >In a 2-frame page:
> >I display records from an accessdb in frame 1. I want
> >to mark 1 or several records in order to delete them. I
> >mark them with check boxes but I can't find out how to
> >send the marked records to the delete page.
> >
> >Is there anyone that can give me a clue.
> >Ted Ljong
> >
> >
> >.
> >



 
Reply With Quote
 
Jim Buyens
Guest
Posts: n/a
 
      26th Oct 2003
"Ted Ljong" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> Hi Jim
> Did I misunderstood you? I appreciate some help with ASP
> Ted Ljong.


Well, if you've written your own ASP page to display the existing
records, I presume you open a recordset containing the records you
want, and then run a loop that creates an HTML table row to display
each record. Here's an example.
<form method="POST" action="delete.asp">
<table>
<tr>
<th>ID</th>
<th>Decription</th>
</tr>
</table>
<%
do until rs.eof
%><tr>
<td><%=rs("recid")%></td>
<td><%=rs("description")%></td>
</tr><%
rs.movenext
loop
%>
<input name="bthDel" type="submit" value="Delete">
</form>

Add a column to that table and then, within the loop, emit an
additional table cell that emits the check box. Be sure to include the
identity of each record in the name of the check box. The loop will
now look like this.

do until rs.eof
%><tr>
<td><input type="checkbox" name="del<%=rs("recid")%>"
value="ON"></td>
<td><%=rs("recid")%></td>
<td><%=rs("description")%></td>
</tr><%
rs.movenext
loop

To see how this works, imagine that the visitor selects the check
boxes for record IDs 5, 10, and 20. In the page that processes the
form, the following expressions will then equal ON.

Request.Form("del5")
Request.Form("del10")
Request.Form("del20")

The page that processes the form should therefore contain this code:

if request.form("bthDel") <> "" then
for each name in request.form
if left(name,3) = "del" then
delid = mid(name,4)
sql = "DELETE from mytable WHERE recid = " & delid & " "
conn.Execute sql
response.write "<p>" & delid & "</p>"
end if
next
end if

Note that unchecked boxes transmit nothing. Thus, if the form contains
a checkbox named del17 and the visitor doesn't clear it, there will be
no such name as del17 in the request.form collection.

To "harden" this application you could, however, check each
Request.Form("del...") entry for a value of ON, or whatever you like.
You should also check each record ID for valid syntax.

If this is way over your head, you probably need to read some books or
get some training in ASP or ASP.NET programming. Tutoring by newsgroup
really isn't practical.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Reply With Quote
 
Ted Ljong
Guest
Posts: n/a
 
      26th Oct 2003
Thanks Jim
Very kind of you to send this answer, I appreciate it.
As a matter of fact I am reading asp books but it isnīt easy, but this very
educational answer will help me a lot.
Thanks again
Ted Ljong


"Jim Buyens" <(E-Mail Removed)> skrev i meddelandet
news:(E-Mail Removed)...
> "Ted Ljong" <(E-Mail Removed)> wrote in message

news:<#(E-Mail Removed)>...
> > Hi Jim
> > Did I misunderstood you? I appreciate some help with ASP
> > Ted Ljong.

>
> Well, if you've written your own ASP page to display the existing
> records, I presume you open a recordset containing the records you
> want, and then run a loop that creates an HTML table row to display
> each record. Here's an example.
> <form method="POST" action="delete.asp">
> <table>
> <tr>
> <th>ID</th>
> <th>Decription</th>
> </tr>
> </table>
> <%
> do until rs.eof
> %><tr>
> <td><%=rs("recid")%></td>
> <td><%=rs("description")%></td>
> </tr><%
> rs.movenext
> loop
> %>
> <input name="bthDel" type="submit" value="Delete">
> </form>
>
> Add a column to that table and then, within the loop, emit an
> additional table cell that emits the check box. Be sure to include the
> identity of each record in the name of the check box. The loop will
> now look like this.
>
> do until rs.eof
> %><tr>
> <td><input type="checkbox" name="del<%=rs("recid")%>"
> value="ON"></td>
> <td><%=rs("recid")%></td>
> <td><%=rs("description")%></td>
> </tr><%
> rs.movenext
> loop
>
> To see how this works, imagine that the visitor selects the check
> boxes for record IDs 5, 10, and 20. In the page that processes the
> form, the following expressions will then equal ON.
>
> Request.Form("del5")
> Request.Form("del10")
> Request.Form("del20")
>
> The page that processes the form should therefore contain this code:
>
> if request.form("bthDel") <> "" then
> for each name in request.form
> if left(name,3) = "del" then
> delid = mid(name,4)
> sql = "DELETE from mytable WHERE recid = " & delid & " "
> conn.Execute sql
> response.write "<p>" & delid & "</p>"
> end if
> next
> end if
>
> Note that unchecked boxes transmit nothing. Thus, if the form contains
> a checkbox named del17 and the visitor doesn't clear it, there will be
> no such name as del17 in the request.form collection.
>
> To "harden" this application you could, however, check each
> Request.Form("del...") entry for a value of ON, or whatever you like.
> You should also check each record ID for valid syntax.
>
> If this is way over your head, you probably need to read some books or
> get some training in ASP or ASP.NET programming. Tutoring by newsgroup
> really isn't practical.
>
> Jim Buyens
> Microsoft FrontPage MVP
> http://www.interlacken.com
> Author of:
> *------------------------------------------------------*
> |\----------------------------------------------------/|
> || Microsoft Office FrontPage 2003 Inside Out ||
> || Microsoft FrontPage Version 2002 Inside Out ||
> || Web Database Development Step by Step .NET Edition ||
> || Troubleshooting Microsoft FrontPage 2002 ||
> || Faster Smarter Beginning Programming ||
> || (All from Microsoft Press) ||
> |/----------------------------------------------------\|
> *------------------------------------------------------*



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Check Boxes Karen Microsoft Excel Misc 3 18th Jun 2008 09:31 PM
delete check boxes Beans Microsoft Excel Misc 2 10th Apr 2008 07:52 PM
Delete check boxes automatically jcvanderhorst@gmail.com Microsoft Excel Programming 4 27th Sep 2006 08:13 PM
Macros to delete check boxes =?Utf-8?B?R1dCIERpcmVjdA==?= Microsoft Excel Misc 23 3rd Jun 2005 09:56 PM
How do you delete excel check boxes? lewis71 Microsoft Excel New Users 7 5th Apr 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 PM.