Send email (and include all records, not just one) |
10/5/2006 2:44:33 PM |
ASPRunnerPro General questions | |
I'm using Events to send an email. I would like all the records displayed to be sent. As my code is now... I just get two rows of data sent. How can I add some sort of Loop to my code? Thanks! |
|
J
|
Jane 10/6/2006 |
Hi, set rs = CreateObject("ADODB.Recordset") rs.Open "select count() from TableName", dbConnection set rsOld = CreateObject("ADODB.Recordset") email="jane@xlinesoft.com" message="" subject="Sample subject" strSQL = "select from TableName" rsOld.Open strSQL, dbConnection NumberOfRecords=0 while not rsOld.eof and NumberOfRecords<rs(0) for i=0 to rsOld.Fields.Count-1 if not IsBinaryField(rsOld.Fields(i)) then _ message = message & rsOld.Fields(i).Name & " : " & rsOld(rsOld.Fields(i).Name) & vbcrlf next NumberOfRecords = NumberOfRecords+1 wend rsOld.Close set rsOld = Nothing sendmail email, subject, message End Sub |
|
cagleyleslie author 10/6/2006 |
THANK you for your help! Is there any way I can make this send as html email? I've been trying to figure it out, but so far am having no luck. Thanks again! |
![]() |
Sergey Kornilov admin 10/8/2006 |
This article can help you: |