SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
EMailing a Table

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
EMailing a Table
Author Message
shawn29316



Joined: 27 Dec 2007
Posts: 27
Country: United States

Post EMailing a Table Reply with quote
Hi,

I need to email a table from ACCESS and I'm struggling. I tried exporting to Excel first, which seemed easy but I didn't get the column names in the Excel file. Can you please help me with this?

Thanks,
Shawn
Mon Jan 14, 2008 3:54 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Reply with quote
1. Create a text file headers.csv containing comma separated column names. Make sure it has 2 lines with the second line empty.
2. Export data from Access to a CSV file data.csv
3. Run cmd /C copy header.csv /A + data.csv /A export.csv This command will concatenate 2 files together.
4. Email export.csv as an attachment.


Hope this helps
Mon Jan 14, 2008 4:31 pm View user's profile Send private message
shawn29316



Joined: 27 Dec 2007
Posts: 27
Country: United States

Post Reply with quote
Thanks, that worked.

Is there a way using that command that I can append the date to the filename I'm creating?

Thanks,
Tue Jan 15, 2008 8:16 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Reply with quote
You can use @T macro variable, for example,

Code:
Dim(pid, number)
RunAndWait("cmd /C copy header.csv /A + C:\\work\\data.csv /A C:\\work\\export@T"mmddyyyy".csv", "", 0, pid)
MailSendWithAttachment(.... "C:\\work\\export@T"mmddyyyy".csv")
FileDelete("C:\\work\\data.csv")
FileDelete("C:\\work\\export@T"mmddyyyy".csv")

Tue Jan 15, 2008 11:11 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.