P
Perry Reynolds
Hi,
I am writing a script to send customers an email copy of their
shopping cart recipt. While creating the variable "mailbody" which
will be plugged into my CDO.htmlbody, I need to gather some
information about their order. The script does a "Do while not
rs.eof" and assigns each rs(field) to a variable, which is then added
to the mailbody variable. Unfortunately, when i ask for the mailbody
variable later, I lose all of the information added to the variable
during my loop. I've tried everything I can think of to correct this
so I was hoping somebody out there would have some ideas. Is there a
better way of doing this? Script is included below.
Thanks,
Perry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mailbody = mailbody & "</tr>"
'$$$$$
'<problem area>
'$$$$$
If Not rs.EOF Then
rs.MoveFirst
rs.PageSize = NrPerPage
TotalPages = rs.PageCount
rs.AbsolutePage = CurrentPage
trow="#FCFBFF"
Do while not rs.eof and Count1 < rs.PageSize
emorderno=rs("orderno")
emcustomer=rs("customer")
emadate=rs("adate")
empartno=rs("code")
emqty=rs("qty")
emshipcode=rs("shipcode")
emusername=rs("username")
emdescr=rs("description")
if len(emdescr)>30 Then
emdescr=Left(emdescr,30) & "..."
end if
mailbody = mailbody & "<tr><td bgcolor='" & trow & "'><img border='0'
alt='" & txt & "' src='http://www.rubber-seal.com/cart3/img/" &
emstatus & ".gif'></td>"
mailbody = mailbody & "<tr><td></td></tr><td bgcolor=" & trow& ">" &
emcode
mailbody = mailbody & "<font color='#6699FF' title='" &emcomment& "'
size='1'>"
mailbody = mailbody & " " & left(comment,50) & "</font></td>"
mailbody = mailbody & "<td bgcolor=" &trow& " align='center'>" &emqty&
"</td>"
count1=count1+1
if trow="#FCFBFF" Then
trow="#FFFFFF"
Else
trow="#FCFBFF"
End if
rs.movenext
loop
end if
rs.close
'$$$$$
'</problem area>
'$$$$$
I am writing a script to send customers an email copy of their
shopping cart recipt. While creating the variable "mailbody" which
will be plugged into my CDO.htmlbody, I need to gather some
information about their order. The script does a "Do while not
rs.eof" and assigns each rs(field) to a variable, which is then added
to the mailbody variable. Unfortunately, when i ask for the mailbody
variable later, I lose all of the information added to the variable
during my loop. I've tried everything I can think of to correct this
so I was hoping somebody out there would have some ideas. Is there a
better way of doing this? Script is included below.
Thanks,
Perry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mailbody = mailbody & "</tr>"
'$$$$$
'<problem area>
'$$$$$
If Not rs.EOF Then
rs.MoveFirst
rs.PageSize = NrPerPage
TotalPages = rs.PageCount
rs.AbsolutePage = CurrentPage
trow="#FCFBFF"
Do while not rs.eof and Count1 < rs.PageSize
emorderno=rs("orderno")
emcustomer=rs("customer")
emadate=rs("adate")
empartno=rs("code")
emqty=rs("qty")
emshipcode=rs("shipcode")
emusername=rs("username")
emdescr=rs("description")
if len(emdescr)>30 Then
emdescr=Left(emdescr,30) & "..."
end if
mailbody = mailbody & "<tr><td bgcolor='" & trow & "'><img border='0'
alt='" & txt & "' src='http://www.rubber-seal.com/cart3/img/" &
emstatus & ".gif'></td>"
mailbody = mailbody & "<tr><td></td></tr><td bgcolor=" & trow& ">" &
emcode
mailbody = mailbody & "<font color='#6699FF' title='" &emcomment& "'
size='1'>"
mailbody = mailbody & " " & left(comment,50) & "</font></td>"
mailbody = mailbody & "<td bgcolor=" &trow& " align='center'>" &emqty&
"</td>"
count1=count1+1
if trow="#FCFBFF" Then
trow="#FFFFFF"
Else
trow="#FCFBFF"
End if
rs.movenext
loop
end if
rs.close
'$$$$$
'</problem area>
'$$$$$