Command Line - Export

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skkydiver
    New Member
    • Jan 2008
    • 4

    Command Line - Export

    Hello,

    Is there a way to use the command line (Access 2003) to export Access tables to text files?

    Thanks

    skkydiver
  • zaidlig
    New Member
    • Jan 2008
    • 45

    #2
    Create a macro "Macro1" that exports the text file you want and closes the DB.

    Then add "/x Macro1" to you command line.

    Comment

    • skkydiver
      New Member
      • Jan 2008
      • 4

      #3
      Originally posted by zaidlig
      Create a macro "Macro1" that exports the text file you want and closes the DB.

      Then add "/x Macro1" to you command line.

      Thank you for the reply, I tried your suggestion and I have not been able to get it to do what I want. Specifically (failed to mention this earlier) that I would like this to be dynamic in nature, that is, I would like to be able to specify the following at the time of the execution of the Macro:

      1. name of the source database
      2. format of the output ( comma or tab delimited)
      3. name of the output file

      Is this possible?

      thanks

      Comment

      • zaidlig
        New Member
        • Jan 2008
        • 45

        #4
        Originally posted by skkydiver
        Thank you for the reply, I tried your suggestion and I have not been able to get it to do what I want. Specifically (failed to mention this earlier) that I would like this to be dynamic in nature, that is, I would like to be able to specify the following at the time of the execution of the Macro:

        1. name of the source database
        2. format of the output ( comma or tab delimited)
        3. name of the output file

        Is this possible?

        thanks
        Here is the link to the full set of command line switches.

        http://support.microso ft.com/kb/209207

        However why not just either create an Access object in whatever is calling Access (such as Word or Excel) and feed it all your variables directly or link to the Access tables that have the data you want exported.

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by skkydiver
          Hello,

          Is there a way to use the command line (Access 2003) to export Access tables to text files?

          Thanks

          skkydiver
          [CODE=vb]
          'The following code will transfer the Table you specify to a Delimited Text File
          DoCmd.TransferT ext acExportDelim, , "<Table Name>", "C:\<Absolu te Path>\<File Name>.txt", True[/CODE]

          Comment

          Working...