 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
shawn29316
Joined: 27 Dec 2007 Posts: 27 Country: United States |
|
EMailing a Table |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7966
|
|
|
|
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 |
|
 |
shawn29316
Joined: 27 Dec 2007 Posts: 27 Country: United States |
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7966
|
|
|
|
You can use @T macro variable, for example,
 |
 |
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 |
|
 |
|
|
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
|
|
|