473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Mailing App Duplicate problem...

@sh
Guys,

I've written an email sending script to mass send to our database - some of
our subscribers are subscribed to multiple list, and so when selecting the
entire database, I want to ensure I don't have Duplicates.

To avoid this, I am selecting the recordset of all users, ordering by Email
address, sending the email, moving onto the next record and then starting a
loop to keep looping until the email address is different, but it doesn't
work... see example below...

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

Do While NOT RS_RecipientsForCampaign.EOF

SEND THE EMAIL HERE...

RS_RecipientsForCampaign.MoveNext

If NOT RS_RecipientsForCampaign.EOF Then
** Do While TheUsersEmailAddress =
RS_RecipientsForCampaign("Email") AND NOT RS_RecipientsForCampaign.EOF
RS_RecipientsForCampaign.MoveNext
Loop
End If

Loop

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

When running, the script works fine, BUT I get an Unspecified error (I HATE
that message) at the end of the script, pointing me to the line number
marked with ** above.

How can I cure this? I've tried everything but need a solution to amend this
section of code that works!!

Cheers, Ash
Jul 6 '06 #1
6 1089
@sh
Actually, sorry just to confirm, here is the exact error message...

error '80020009'
Exception occurred.
blah.asp, line 799

"@sh" <sp**@spam.comwrote in message
news:6M******************************@bt.com...
Guys,

I've written an email sending script to mass send to our database - some
of our subscribers are subscribed to multiple list, and so when selecting
the entire database, I want to ensure I don't have Duplicates.

To avoid this, I am selecting the recordset of all users, ordering by
Email address, sending the email, moving onto the next record and then
starting a loop to keep looping until the email address is different, but
it doesn't work... see example below...

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

Do While NOT RS_RecipientsForCampaign.EOF

SEND THE EMAIL HERE...

RS_RecipientsForCampaign.MoveNext

If NOT RS_RecipientsForCampaign.EOF Then
** Do While TheUsersEmailAddress =
RS_RecipientsForCampaign("Email") AND NOT RS_RecipientsForCampaign.EOF
RS_RecipientsForCampaign.MoveNext
Loop
End If

Loop

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

When running, the script works fine, BUT I get an Unspecified error (I
HATE that message) at the end of the script, pointing me to the line
number marked with ** above.

How can I cure this? I've tried everything but need a solution to amend
this section of code that works!!

Cheers, Ash

Jul 6 '06 #2
@sh wrote:
Guys,

I've written an email sending script to mass send to our database -
some of our subscribers are subscribed to multiple list, and so when
selecting the entire database, I want to ensure I don't have
Duplicates.

To avoid this, I am selecting the recordset of all users, ordering by
Email address, sending the email, moving onto the next record and
then starting a loop to keep looping until the email address is
different, but it doesn't work... see example below...

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

Do While NOT RS_RecipientsForCampaign.EOF

SEND THE EMAIL HERE...

RS_RecipientsForCampaign.MoveNext

If NOT RS_RecipientsForCampaign.EOF Then
** Do While TheUsersEmailAddress =
RS_RecipientsForCampaign("Email") AND NOT RS_RecipientsForCampaign.EOF
RS_RecipientsForCampaign.MoveNext
Loop
End If

Loop

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

When running, the script works fine, BUT I get an Unspecified error
(I HATE that message) at the end of the script, pointing me to the
line number marked with ** above.

How can I cure this? I've tried everything but need a solution to
amend this section of code that works!!
You should be able to construct a query that returns unique addresses.
However, the details for how that would be done depend on the database
type and version you are using (please always supply this information
when requesting database-related help. It is almost always relevant)

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 6 '06 #3
@sh
You should be able to construct a query that returns unique addresses.
However, the details for how that would be done depend on the database
type and version you are using (please always supply this information
when requesting database-related help. It is almost always relevant)
Thanks for your reply. We're using SQLServer v7, I did consider how to
return unique addresses, perhaps by using Distinct, but we also need
alongside that the other details for the user, for example title, firstname,
lastname etc.

Surely there is a simple solution to get this script working? What am I
missing?
Jul 6 '06 #4
@sh
Just solved it myself, for anyone else with the same problem, you need to
look into the 'Exit Do' function, VERY DAMN HANDY!!!!

Final code bit now looks like this...

Do While NOT RS_RecipientsForCampaign.EOF
If (TheUsersEmailAddress <>
RS_RecipientsForCampaign("Email")) Then
Exit Do
Else
RS_RecipientsForCampaign.MoveNext
End If
Loop

Cheers, @sh
"@sh" <sp**@spam.comwrote in message
news:a5******************************@bt.com...
>You should be able to construct a query that returns unique addresses.
However, the details for how that would be done depend on the database
type and version you are using (please always supply this information
when requesting database-related help. It is almost always relevant)

Thanks for your reply. We're using SQLServer v7, I did consider how to
return unique addresses, perhaps by using Distinct, but we also need
alongside that the other details for the user, for example title,
firstname, lastname etc.

Surely there is a simple solution to get this script working? What am I
missing?

Jul 6 '06 #5
@sh wrote:
>You should be able to construct a query that returns unique
addresses. However, the details for how that would be done depend on
the database type and version you are using (please always supply
this information when requesting database-related help. It is almost
always relevant)

Thanks for your reply. We're using SQLServer v7, I did consider how to
return unique addresses, perhaps by using Distinct, but we also need
alongside that the other details for the user, for example title,
firstname, lastname etc.
Then use GROUP BY

Of course, now I need to know something about your table's structure.
However, something like:

SELECT email, Max(title) title, Max(firstname) firstname,
Max(lastname) lastname
from table
group by email
>
Surely there is a simple solution to get this script working?
Probably, but I wouldn't bother with this inefficient technique.
Concentrate on retrieving the correct data from your database. Never
retrieve more data than you are going to use.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 6 '06 #6
@sh
Thanks for your help Bob, will look at reworking the SQL later on, got to
just get the thing working for now ;o)

Cheers, @sh
Jul 6 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: robert | last post by:
Hi All Im building my first php site and what im looking for is a simple tutuorial / example of a form which allows users to enter their email address, which is stored in my Mysql db. Also...
3
by: Mohammed Mazid | last post by:
Hi, Basically I have a problem with registering to my quiz system. I had borrowed some code from an existing program but I just do not know why it doesn't work. If (txtUsername = "" Or...
0
by: Brian van den Broek | last post by:
Hi all, There have been a few posts over the last month or so expressing a bit of exasperation with the "rising tide of newbie's". (Or, more accurately, the rising tide of questions from...
3
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
2
by: dougjrs | last post by:
I have a table that has a list of people that I would like to do a mailing to. The table has the fields First Name, Last Name, House number, Street name, City, State, ZipCode. What I would like...
9
by: vbportal | last post by:
Hi, I would like to add BitArrays to an ArrayList and then remove any duplicates - can someone please help me forward. I seem to have (at leaset ;-) )2 problems/lack of understanding (see test...
7
by: 3KWA | last post by:
Hi all, I tried to send a small mailing list using python today (2036 emails). For that purpose I looked in the doc for some code examples (I had never done it before). And I ended up writing...
0
by: Johan P | last post by:
Having just compiled DBG 2.15.1 and trying to use it with PHP (cli) give some some problem. Verions: DBG 2.15.1 PHP 4.4.4 (cli) It works fine compiled with the Apache module but when I try...
7
by: Dave | last post by:
Hi all I have a student database where I would like to be able to print just one mailing label, for the student whose record I am currently accessing on the form. I want to be able to click on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.