Consulting

Results 1 to 9 of 9

Thread: Export all Access tables to CSV

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Export all Access tables to CSV

    I tried the code as per a previous thread to export all tables in an Access database to text files:


    Option Compare Database
    
    Public Sub ExportAll()
        Dim strFolder As String
        strFolder = Application.CurrentProject.Path & ""
        Dim obj As AccessObject, dbs As Object
        Set dbs = Application.CurrentData
        For Each obj In dbs.AllTables
            If Left(obj.Name, 4) <> "MSys" Then
                DoCmd.TransferText acExportDelim, "Table1 Export Specification", obj.Name, strFolder & obj.Name & ".csv", True
            End If
        Next obj
    End Sub
    This exports the first table, but not the second one with a table name of users. The error message is "The Microsoft Access database engine could not find the object users#csv.


    I added the export specification (export as tab delimited) to the DoCmd.TransferText command as without it, the following error was displayed: 3441 Text file specification field separator matches decimal separator or text delimiter. I changed my region settings from:
    Decimal symbol (.), Digit grouping symbol (,) and List separator (,) to
    Decimal symbol (,), Digit grouping symbol (space) and List separator (,)
    and various other combinations, but it still did not work.


    Your assistance will be highly appreciated. I use Office 365 and Windows 10 Pro.
    Last edited by Aussiebear; 06-16-2025 at 12:42 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •