473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Email attachments?

Hi

I'm in the process of converting an access db to vb2005. My old app has
code that sends an email with a table attachment formatted to excel. I want
to do the same within vb, i.e. create an email via code and attach the
records from an SQL table preferrably in xls format. The creating the email
is no problem, but am not sure of the best method to attach the records. I
now I could scroll through a dataset and use those records but was wondering
if there is a better way.

Thanks
Jan 12 '06 #1
11 1386
Hi,

you can use dataset.WriteXml() to create an xml file based on the dataset.

Hth,
Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)
"Chubbly Geezer" <ch************@newsgroup.nospam> schreef in bericht
news:#p**************@TK2MSFTNGP11.phx.gbl...
Hi

I'm in the process of converting an access db to vb2005. My old app has
code that sends an email with a table attachment formatted to excel. I want to do the same within vb, i.e. create an email via code and attach the
records from an SQL table preferrably in xls format. The creating the email is no problem, but am not sure of the best method to attach the records. I now I could scroll through a dataset and use those records but was wondering if there is a better way.

Thanks

Jan 12 '06 #2
Hi Chubbly,

Welcome to MSDN newsgroup!

As Greetz's suggestion, I think the dataset.WriteXml() method is suitable
for the current scenario. You can use the xml generated by the method in
the mail.

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Yuan Ren [MSFT]
Microsoft Online Support

Jan 13 '06 #3
Hi I have to say I like my new name, Greetz ;-)

but it actualy is Peter ;-)

Greetz (short for greetings) Peter :-)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

""Yuan Ren[MSFT]"" <v-****@microsoft.com> schreef in bericht
news:K9**************@TK2MSFTNGXA02.phx.gbl...
Hi Chubbly,

Welcome to MSDN newsgroup!

As Greetz's suggestion, I think the dataset.WriteXml() method is suitable
for the current scenario. You can use the xml generated by the method in
the mail.

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Yuan Ren [MSFT]
Microsoft Online Support

Jan 13 '06 #4
Yuan,

The guys name is Peter a regular (replier) in this newsgroup.

With Greetz he says something as.

See you.

:-))

Cor
Jan 13 '06 #5
It took a while that I renewed my mails. My message was seperate from yours
not an addition.

Cor
Jan 13 '06 #6
Hi Peter and Cor,

Thanks for you guys' reminder. Please forgive me for carelessness. But I
think maybe Peter are happy man so he "greet" all the time. Haha:)

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Jan 16 '06 #7
Indeed, I am a happy man :-) ;-)

Greetz Peter
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

""Yuan Ren[MSFT]"" <v-****@microsoft.com> schreef in bericht
news:Go**************@TK2MSFTNGXA02.phx.gbl...
Hi Peter and Cor,

Thanks for you guys' reminder. Please forgive me for carelessness. But I
think maybe Peter are happy man so he "greet" all the time. Haha:)

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Jan 16 '06 #8
Thanks Guys.

Not really had much use for XML to date, so a bit green.

I'll look up the use and syntax in 'Help', unless you can point me in the
right direction.
I'm assuming I do not need to save the XML output to a file and then attach
the file. Can I just attached the XML output directly to the email. In
either instance, how would I use the XML with Excel.

thanks again

Chubbly


""Yuan Ren[MSFT]"" <v-****@microsoft.com> wrote in message
news:K9**************@TK2MSFTNGXA02.phx.gbl...
Hi Chubbly,

Welcome to MSDN newsgroup!

As Greetz's suggestion, I think the dataset.WriteXml() method is suitable
for the current scenario. You can use the xml generated by the method in
the mail.

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Yuan Ren [MSFT]
Microsoft Online Support

Jan 16 '06 #9
Hi Chubbly,

Thanks for your reply!

Let me explain my understanding for the current issue. There is a dataset
object and you want to export it to an xml data output. Then, you want to
use the output with the XSL format to generate a new output for the body of
the e-mail. If I have misunderstood anything, please let me know.

For this scenario, I suggest you export to the xml data output by calling
dataset.WriteXml method.

This method can write the object data into an output as the XmlReader,
string or file object. Then you use the output with calling
XslTransform.Transform method to generate a new output as the XmlReader,
string or file object. At last, you can attach the output into the body of
the email.

Below is a MSDN document which has more detailed information for these
methods:
WriteXml:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatasetclasswritexmltopic1.asp

Transform:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemxmlxslxsltransformclasstransformtopic8. asp

Additionally, here are some good samples from third party issues. These
samples demonstrate the implementation of the current issue:
ˇ°A Free HTML Report generator for DataSetsˇ±:
http://www.codeproject.com/csharp/datasetreportview.asp

ˇ°Programmatically using ADO.NET and XMLˇ±:
http://www.codeproject.com/cs/databa...ET_and_XML.asp

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Jan 17 '06 #10
What would be ideal is what our old system did in that it exported the
contents of an SQL table to an Excel file an attached this Excel file to an
email for sending.

Access actually did this with a 'sendobject' command and was simple.
However I do not seem able to do the same within VB2005.

Since your last post I've figure old that Excel can actually open and XML
data file, so I guess my best option is to attach one of these to an email.
I do not want to populate the email body at all, just send the table data.

Hope this is clear.

Chubbly
""Yuan Ren[MSFT]"" <v-****@microsoft.com> wrote in message
news:gf*************@TK2MSFTNGXA02.phx.gbl...
Hi Chubbly,

Thanks for your reply!

Let me explain my understanding for the current issue. There is a dataset
object and you want to export it to an xml data output. Then, you want to
use the output with the XSL format to generate a new output for the body
of
the e-mail. If I have misunderstood anything, please let me know.

For this scenario, I suggest you export to the xml data output by calling
dataset.WriteXml method.

This method can write the object data into an output as the XmlReader,
string or file object. Then you use the output with calling
XslTransform.Transform method to generate a new output as the XmlReader,
string or file object. At last, you can attach the output into the body of
the email.

Below is a MSDN document which has more detailed information for these
methods:
WriteXml:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatasetclasswritexmltopic1.asp

Transform:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemxmlxslxsltransformclasstransformtopic8. asp

Additionally, here are some good samples from third party issues. These
samples demonstrate the implementation of the current issue:
ˇ°A Free HTML Report generator for DataSetsˇ±:
http://www.codeproject.com/csharp/datasetreportview.asp

ˇ°Programmatically using ADO.NET and XMLˇ±:
http://www.codeproject.com/cs/databa...ET_and_XML.asp

I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Jan 18 '06 #11
Hi Chubbly,

Thanks for your reply!
"Since your last post I've figure old that Excel can actually open and XML

data file, so I guess my best option is to attach one of these to an email.
I do not want to populate the email body at all, just send the table data."

I can not understand the issue clearly. If you just want to send the table
data, I wonder what origin of the table data is. Could you read the table
data and write it into a dataset object? If you can, I suggest you use the
way I mentioned in the previous thread to add the data into the body of
email.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Jan 19 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul Schmidt | last post by:
Dear list: I am new to python, and I am trying to figure out the short answer on something. I want to open a POP3 mailbox, read the enclosed mail using the POP3 module, , and then process it...
3
by: LutherRevisited | last post by:
Is there a way I can put a message together without having to download any attachments there may be at the same time. I'm not having any problems dealing with attachments, but the way I'm doing...
5
by: morphex | last post by:
Hi, I have an email that's in the utf-8 encoding, and I'm getting this error message when I try to send it using smtplib: * Module smtplib, line 688, in sendmail * Module smtplib, line 485,...
5
by: paii, Ron | last post by:
How do I setup a email with attachment for preview but require the user to push the SEND button in Outlook. I have the following function but it sends the email without the sender ever seeing it. ...
4
by: Russell Bungay | last post by:
Hello all, I have written a short function, based on a recipe in the Python Cookbook, that sends an e-mail. The function takes arguments that define who the e-mail is to, from, the subject, the...
1
by: mike11d11 | last post by:
If someone could help me, I need to be able to send attachments from my access database that I have created. This database runs queries then generates a report off the queries from underlying...
10
by: OdAwG | last post by:
Hello All, Is it possible to send an email from Access? I found a Microsoft article on how to do this but I keep getting an error "RUNTIME ERROR 438" -- Object doesn't support this property or...
10
by: Walshi | last post by:
Hi all, I'm a relative newby to access and VBA etc. My forms and tables etc are working great and saving lots of time...However... I have two databases with the exact same table format. I want...
2
by: oyster | last post by:
I find that the existing email moudle is some hard for me to understand, especially the part of how to set the CC, BCC and attach the files. Is there any more easy one like this p-code? import...
1
by: budyerr | last post by:
All, I am trying to build a email submission form using asp.net. I currently have a web form page that will upload to my webhosting server, attach to email then delete the file after sending. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.