Exporting from Microsoft Access to Excel or .csv

Jefferson

Member
Joined
Aug 16, 2005
Messages
21
Programming Experience
Beginner
Hi,

I have no idea how to start this or what code would be required, seeing as i lost my VB.NET manual.
Basically, I have an application that reads in data from Textbox's, Combo's and datetimepickers from users and adds this to a Access Database.

I need to export the information from the MS-Access Database into either a Excel or csv file via a click event in the application...

If anyone could help me out with this, or point me to some easy to read (code samples for vb.net) articles, i would appreciate this greatly.

Jefferson
 
a cvs should be no problem because it is nothing more than a text file with the cvs extension and all fields seperated by a comma or semicolon. You can build this up using a StringBuilder and then when ready write it to a file using the streamwriter.

For excel its another story, because these are binary files you can't just create them. You could try the Office dll for .net and use the excel document object model to create a real excel file.

For examples I advise to to google for it using real text searching queries like 'export ms access to excel vb.net' these might seem trivial but they actually deliver some good results!
 
u can create csv file and connect using text driver

strConncsv = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + strImportfolder + ";Extensions=asc,csv,tab,txt;Persist Security Info=False;"
 
CSV instead of DB - Resolved

Hi Guys,

Thanks for information,
I was having problems saving to the database after creating the setup, so i changed to AddRecord() to write to a CSV file using streamwriter.

My thanks again for the support.
Jefferson
 
Back
Top