|
 |
access_asp thread: SORRY...BUT I AM GOING INSANE!!!!
Message #1 by "Dale James Wright" <dwright@c...> on Thu, 3 Oct 2002 17:25:21
|
|
Please please can someone help me with this!
"""I know i shouldnt duplicate messages, but i solved the last problem
concering this issue...."""
I have a page that checks a database to see if a users problem call has
been closed.... if the call is closed, an email is sent to that user via
CDONTS.....This is only sent once the condition is true (ie that the date
in the field matches TODAYS date)
Now there is no problems in doing this, but the MAIN problem is as follows:
The email is sent to all those who match the criteria... Record/User 1
receives an email with their details....
Record/User 2 also receives an email with their details but also with
Record/USer 1's details.....
Record/User 3 also receives an email with their details but also with
Record/USer 1's & 2' details..... Got the drift!!!!!!!!!
Why the help this is doing this i dont know, but i cannot figure this
out... i know that it will be something simple, but i just cant figure out
what!!!!1
What should happen is that user 1 receives his confirmation/information
that their call is closed.
User 2 receives his confirmation/information that their call is closed.
User 3 receives his confirmation/information that their call is closed.
Sounds Simple dosent it????Well it isnt.ahhhhhhhhhhh i am about to pull my
hair out.....
if you could help, please do so.... here is my code......
Dim oConn
Dim oRS
Set oConn = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
SQLtxt = "SELECT Calls.Callid, Calls.ContactID,
Calls.Forename, CallsHistory.Action, Calls.Surname, Calls.Email,
CallsHistory.Notes, Calls.DateClosed "
SQLtxt = SQLtxt & " FROM Calls INNER JOIN CallsHistory ON
Calls.Callid = CallsHistory.FKey "
SQLtxt = SQLtxt & " WHERE (((CallsHistory.Action)=4))
ORDER BY Calls.CallID;"
oRS.Open SQLtxt,"DSN=sunrise_db"
While Not oRS.EOF
If oRS("DateClosed") = Date() Then
Set objMail = Server.CreateObject("CDONTS.NewMail")
HTML = HTML & "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<BODY bgcolor=white>Does
this work?"
HTML = HTML & "" & ors("Forename") & ""
HTML = HTML & "</BODY>"
HTML = HTML & "</HTML>"
objMail.From = "400@m..."
objMail.Subject = "Does it work"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = oRS("Email")
objMail.Body = HTML
objMail.Send
Set objMail = Nothing
Response.Write "" & oRS("Forename") & " " & oRS
("Surname") & ""
End if
oRS.Movenext
Wend
Set ors = nothing
Set oconn = nothing
%>
Thankyou very much
Message #2 by "Zee Computer Consulting" <zee@t...> on Thu, 3 Oct 2002 10:52:32 -0700
|
|
Instead of:
HTML = HTML & "HTML"
use this:
HTML = "<HTML>"
at the beginning of each loop -- you current code never re-starts the HTML
variable, so you just keep adding to it..
-- Zee
----- Original Message -----
From: "Dale James Wright" <dwright@c...>
To: "Access ASP" <access_asp@p...>
Sent: Thursday, October 03, 2002 5:25 PM
Subject: [access_asp] SORRY...BUT I AM GOING INSANE!!!!
> Please please can someone help me with this!
>
> """I know i shouldnt duplicate messages, but i solved the last problem
> concering this issue...."""
>
> I have a page that checks a database to see if a users problem call has
> been closed.... if the call is closed, an email is sent to that user via
> CDONTS.....This is only sent once the condition is true (ie that the date
> in the field matches TODAYS date)
>
> Now there is no problems in doing this, but the MAIN problem is as
follows:
>
> The email is sent to all those who match the criteria... Record/User 1
> receives an email with their details....
>
> Record/User 2 also receives an email with their details but also with
> Record/USer 1's details.....
>
> Record/User 3 also receives an email with their details but also with
> Record/USer 1's & 2' details..... Got the drift!!!!!!!!!
>
> Why the help this is doing this i dont know, but i cannot figure this
> out... i know that it will be something simple, but i just cant figure out
> what!!!!1
>
> What should happen is that user 1 receives his confirmation/information
> that their call is closed.
>
> User 2 receives his confirmation/information that their call is closed.
>
> User 3 receives his confirmation/information that their call is closed.
>
> Sounds Simple dosent it????Well it isnt.ahhhhhhhhhhh i am about to pull my
> hair out.....
>
> if you could help, please do so.... here is my code......
>
>
> Dim oConn
> Dim oRS
>
> Set oConn = Server.CreateObject("ADODB.Connection")
> Set oRS = Server.CreateObject("ADODB.Recordset")
>
> SQLtxt = "SELECT Calls.Callid, Calls.ContactID,
> Calls.Forename, CallsHistory.Action, Calls.Surname, Calls.Email,
> CallsHistory.Notes, Calls.DateClosed "
> SQLtxt = SQLtxt & " FROM Calls INNER JOIN CallsHistory ON
> Calls.Callid = CallsHistory.FKey "
> SQLtxt = SQLtxt & " WHERE (((CallsHistory.Action)=4))
> ORDER BY Calls.CallID;"
>
> oRS.Open SQLtxt,"DSN=sunrise_db"
>
> While Not oRS.EOF
>
> If oRS("DateClosed") = Date() Then
>
> Set objMail = Server.CreateObject("CDONTS.NewMail")
> HTML = HTML & "<HTML>"
> HTML = HTML & "<HEAD>"
> HTML = HTML & "<BODY bgcolor=white>Does
> this work?"
> HTML = HTML & "" & ors("Forename") & ""
> HTML = HTML & "</BODY>"
> HTML = HTML & "</HTML>"
> objMail.From = "400@m..."
> objMail.Subject = "Does it work"
>
> objMail.BodyFormat = 0
> objMail.MailFormat = 0
>
> objMail.To = oRS("Email")
> objMail.Body = HTML
> objMail.Send
>
> Set objMail = Nothing
>
> Response.Write "" & oRS("Forename") & " " & oRS
> ("Surname") & ""
>
> End if
>
> oRS.Movenext
>
> Wend
>
> Set ors = nothing
> Set oconn = nothing
>
> %>
>
>
> Thankyou very much
>
|
|
 |