From: Les Juby on
Hi

I've had this problem before in other apps, and hacked off on a
workaround, but I think I'm trapped this time.....

Basically, a list of found records is presented to the visitor for
previewing before a set email message is sent to each of the found
records.

But I need to give the visitor the ability to remove at least several
of the records before firing off the emails.

Ideally, a checkbox alongside each record and a [Delete Marked] button
would be great.!

Can anyone please suggest a resource where this is explained - or
maybe some pointers on how to achieve it.?

What would the basic code be to remove items from the current
recordset, as opposed to messing with writing back to the database and
getting a new recordset.?

thanks

.les.

From: Bob Barrows on
Why mess with the recordset? Your email form should be processing form
submission results.

The process should be:
The user requests the page that begins the process.
That page retrieves the recordset from the database and writes the contents
to Response to display to the user, closing the recordset before ending the
response.
The user clicks your checkboxes beside the records he wishes to be processed
and submits the form to your email page.
Your email page loops through the request.form data and sends emails for the
data for which the checkbox is checked.

This will obviously involve naming the checkboxes with some text to identify
which record the checkbox is controlling.


Les Juby wrote:
> Hi
>
> I've had this problem before in other apps, and hacked off on a
> workaround, but I think I'm trapped this time.....
>
> Basically, a list of found records is presented to the visitor for
> previewing before a set email message is sent to each of the found
> records.
>
> But I need to give the visitor the ability to remove at least several
> of the records before firing off the emails.
>
> Ideally, a checkbox alongside each record and a [Delete Marked] button
> would be great.!
>
> Can anyone please suggest a resource where this is explained - or
> maybe some pointers on how to achieve it.?
>
> What would the basic code be to remove items from the current
> recordset, as opposed to messing with writing back to the database and
> getting a new recordset.?
>
> thanks
>
> .les.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


From: Les Juby on
Thanks for that.

I follow it all up to the point where you say "submits the form to
your email page"

Normally, if the recordset was still open, then the email page would
cycle through the recordset collecting data from each line and firing
off the email. My query was how the checkbox field would add itself to
the recordset to allow me to do this.

But if the recordset is closed as you suggest, then I would have to
cycle through the form to pick up which records need the emails. And
I guess I'd then open a record to send each one.

But my problem then becomes: - "how do you cycle through multiple
responses in a form". I seem to have a mindset that restricts me to
recordsets and maybe this is somethingIi just have not done before.
Any snippet or example you could maybe point me to.?

Thanks for the help.

.les.


On Thu, 28 Jan 2010 16:56:34 -0500, "Bob Barrows"
<reb01501(a)NOyahoo.SPAMcom> wrote:

>Why mess with the recordset? Your email form should be processing form
>submission results.
>
>The process should be:
>The user requests the page that begins the process.
>That page retrieves the recordset from the database and writes the contents
>to Response to display to the user, closing the recordset before ending the
>response.
>The user clicks your checkboxes beside the records he wishes to be processed
>and submits the form to your email page.
>Your email page loops through the request.form data and sends emails for the
>data for which the checkbox is checked.
>
>This will obviously involve naming the checkboxes with some text to identify
>which record the checkbox is controlling.
>
>
>Les Juby wrote:
>> Hi
>>
>> I've had this problem before in other apps, and hacked off on a
>> workaround, but I think I'm trapped this time.....
>>
>> Basically, a list of found records is presented to the visitor for
>> previewing before a set email message is sent to each of the found
>> records.
>>
>> But I need to give the visitor the ability to remove at least several
>> of the records before firing off the emails.
>>
>> Ideally, a checkbox alongside each record and a [Delete Marked] button
>> would be great.!
>>
>> Can anyone please suggest a resource where this is explained - or
>> maybe some pointers on how to achieve it.?
>>
>> What would the basic code be to remove items from the current
>> recordset, as opposed to messing with writing back to the database and
>> getting a new recordset.?
>>
>> thanks
>>
>> .les.


o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
Les Juby lesjuby(a)anti-spam.iafrica.com
Webpro Internet - - - Prosoft Microsystems
Durban, KwaZulu-Natal, South Africa
P.O.Box 35243, Northway 4065, South Africa
Tel: +27 31 563-8344 Fax: +27 31 564-4928
o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
(you *do* know to take "anti-spam" out the address....?
From: Bob Barrows on
Les Juby wrote:
> Thanks for that.
>
> I follow it all up to the point where you say "submits the form to
> your email page"
>
> Normally, if the recordset was still open,

Unless you've used a disconnected recordset which you have persisted to
an xml file, then, of course the recordset is closed. it cannot stay
open when the response ends.

> then the email page would
> cycle through the recordset collecting data from each line and firing
> off the email. My query was how the checkbox field would add itself to
> the recordset to allow me to do this.
>
> But if the recordset is closed as you suggest, then I would have to
> cycle through the form to pick up which records need the emails. And
> I guess I'd then open a record to send each one.
Why would you have to open a record? The data you need from the
recordset should still be in the submitted form data. Unless you need
extra data from the database that you have not sent to the client in the
first step, there seems to be absolutely no need to go back to the
database for anything.

>
> But my problem then becomes: - "how do you cycle through multiple
> responses in a form". I seem to have a mindset that restricts me to
> recordsets and maybe this is somethingIi just have not done before.
> Any snippet or example you could maybe point me to.?

There are many examples posted in this newsgroup, as well as the
..inetserver.asp.db newsgroup. In fact, I posted some snippets in a
recent thread in that group that should get you going. The subject is
"Insert more than one record at a time" and it was started by S N.


--
HTH,
Bob Barrows


From: Neil Gould on
Hi Les,

Les Juby wrote:
> Hi
>
> I've had this problem before in other apps, and hacked off on a
> workaround, but I think I'm trapped this time.....
>
> Basically, a list of found records is presented to the visitor for
> previewing before a set email message is sent to each of the found
> records.
>
> But I need to give the visitor the ability to remove at least several
> of the records before firing off the emails.
>
> Ideally, a checkbox alongside each record and a [Delete Marked] button
> would be great.!
>
> Can anyone please suggest a resource where this is explained - or
> maybe some pointers on how to achieve it.?
>
> What would the basic code be to remove items from the current
> recordset, as opposed to messing with writing back to the database and
> getting a new recordset.?
>
If I follow what you're trying to do, it sounds to me that you are confusing
a number of tasks... the first is to let the visitor choose which records to
delete from a database by selecting items presented in a form by selecting a
checkbox. This is mainly an HTML task, so I would point you to a search with
the terms "HTML Forms" + checkbox. This will give you some ideas about how
to construct your form.

The first ASP task is a matter of how the returned checkbox array can be
parsed for the next task, which is deleting records from your database.
There are many examples of how to do this on such sites as ASP101.com, but
the general idea is that, depending on how your database is set up, you can
use a loop to select the item from the array and delete the corresponding
record.

The next ASP task is sending off an email, and depending on the content of
the email, you could build the portion that references database records
within the above loop, then add whatever other material is necessary to the
CDO message.

Hope this helps...

Neil