Export from to csv file

Posted on 2013-06-05
Last Modified: 2013-06-06
Does anyone know how to export the results of a query to a csv file in 4.0?

Question by:ajdarlow

Assisted Solution

MrC63 earned 250 total points
ID: 39223117
The File System Object (fso) is one way to do it.  See the following link:
LVL 42

Expert Comment

ID: 39224748
can u post the code u use to query the results?
are you getting datatable/dataset as results or datareader?
LVL 69

Accepted Solution

Éric Moreau earned 250 total points
ID: 39225203

Author Closing Comment

ID: 39225269
Thanks guys.

In the end I used the following


        mySqlDataAdapter.Fill(myDataSet, "Tags")
        For Each myDataRow In myDataSet.Tables("Tags").Rows
            strText = myDataRow("TagId") & ", " & myDataRow("TagDesc") & vbCrLf
            My.Computer.FileSystem.WriteAllText(strFileName, strText, True)
        Next myDataRow

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now