but the email attachments are empty (they are an excel file with the correct title - but blank).
with objCmd
.commandText = "br_sp_threeDayReport"
.CommandType = &H0004
End With
set objrs = objcmd.execute()
recCount = 0
do while not objrs.eof
if lcase(objrs("created"

) <> "null" then
if lastName <> "" then
recCount = recCount + 1
if lastName <> objrs("lastName"

then strOut = strOut & "<tr></tr>" '<
end if
lastName = objrs("lastName"

end if
strOut = strOut & objrs(0)
objrs.movenext
loop
if recCount > 0 then ' <'records found'
Set act = fso.CreateTextFile(server.mappath(g_filename), true)
with act
.WriteLine "<html xmlns:x=""urn:schemas-microsoft-com

ffice:excel"">"
.WriteLine "<head>"
.WriteLine "<!--[if gte mso 9]><xml>"
.WriteLine "<x:ExcelWorkbook>"
.WriteLine "<x:ExcelWorksheets>"
.WriteLine "<x:ExcelWorksheet>"
.WriteLine "<x:Name>Items Over 3 Days Old</x:Name>"
.WriteLine "<x:WorksheetOptions>"
.WriteLine "<x

ageSetup>"
.WriteLine "<x:Header>BRTT Active Requests Over 3 Days Old</x:Header>"
.WriteLine "</x

ageSetup>"
.WriteLine "<x

rint>"
.WriteLine "<x:ValidPrinterInfo/>"
.WriteLine "</x

rint>"
.WriteLine "</x:WorksheetOptions>"
.WriteLine "</x:ExcelWorksheet>"
.WriteLine "</x:ExcelWorksheets>"
.WriteLine "</x:ExcelWorkbook>"
.WriteLine "</xml>"
.WriteLine "<![endif]--> "
.WriteLine "</head>"
.WriteLine strOut
end with
act.close
'now mail them'
strSQL = "SELECT firstName, email "&_
"FROM tblPerson p JOIN tbmPersonRole r on p.personID = r.personID "&_
"WHERE r.roleID = (select roleID from tblRole where roleName='Administrator')"
set objrs = objconn.execute(strSQL)
do while not objrs.eof
set objMail = server.createObject("CDONTS.newMail"

with objMail
.From = "joeblow@abc.com"
.To = objrs("email"

.Subject = "Daily Report - Requests Over 3 days Old"
strOut = objrs("firstName"

&_
", <br><br>Your daily report for BRTT requests over 3 days old (starting 3/24/03) is attached.<br>"&_
"The total number of records found is " & recCount & ".<br><br><br>"
.Body = strOut
.AttachFile (server.mappath(g_filename ))
.bodyFormat = 0 'HTML'
.mailFormat = 0 'MIME Format'
.send
end with
objrs.movenext
loop
end if 'records found' Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179