开发者

Convert MDB to CSV [closed]

开发者 https://www.devze.com 2023-03-10 08:17 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

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 question

I 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:

  1. Open a connection to the MDB file through ADO.NET.
  2. Iterate all tables.
  3. Create a text file (CSV) for each table.
  4. For each table, iterate all rows.
  5. For each row, write a new line in the text file.
  6. For each row, iterate all columns.
  7. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消