Retrieve Access Table Data As A File

R

Ragugct

Hi,

I have to get data of all the tables in a Access base and
save it as a files with delimiter. Is there any way to
automate this process for all the tables(Instaed of
opening a table and copy the data and put it into excel
and save it as csv file).

What in my mind is, I need a batch file it connects to
the specific Access Database and get the data for each
table and save it as a file.

Any help is appreciatable
 
V

Van T. Dinh

Check Access VB Help on the TransferText Method.

You can write code to loop through the TableDefs Collection and use
TransferText to export each Table to a CSV file.
 
G

Guest

I uuse this code to export tables to txt files, it works
well for me as these files can then be imported into the
majority of applications.

Add a new module and call the function when you need it!
_____________________________________

Function OutputTable()
On Error GoTo OutputTable_Err

DoCmd.OutputTo acTable, "Table Name1", "MS-DOSText
(*.txt)", "Path1 to Export to", False, ""

DoCmd.OutputTo acTable, "Table Name2", "MS-DOSText
(*.txt)", "Path2 to Export to", False, ""


OutputTable_Exit:
Exit Function

OutputTable_Err:
MsgBox Error$
Resume OutputTable_Exit

End Function
________________________________________________

Reg Edd
 
Top