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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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 70

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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