Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been don开发者_开发技巧e so far to solve it.
Closed 9 years ago.
Improve this questionI have a MS Access mdb file. I need to convert it to a CSV file. How do i do it? Please do not point me to any freeware.
Thanks in advance
Another useful tool is mdbtools:
http://mdbtools.sourceforge.net/
Being no freeware, as you requested, I could recommend you Spectral Core's Full Convert Enterprise.
I've used it successfully in the past, too.
Update:
Since you clarified that you need a programmatic solution, I do recommend you do it manually:
- Open a connection to the MDB file through ADO.NET.
- Iterate all tables.
- Create a text file (CSV) for each table.
- For each table, iterate all rows.
- For each row, write a new line in the text file.
- For each row, iterate all columns.
- For each column, write the value to the text file in the current row.
use this utility its opensource and free mdb to csv convertor: MDBtoCSV
Plotly (https://plot.ly) will convert your MDB files to CSV for free.
EDIT: free Plotly users cannot use this functionality; a subscription is required.
With VBA
Dim db As DAO.Database
Dim tdf As TableDef
Set db = CurrentDb
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
DoCmd.TransferText acExportDelim, , tdf.Name, tdf.Name & ".csv"
End If
Next
-- http://msdn.microsoft.com/en-us/library/aa220768%28v=office.11%29.aspx
精彩评论