ACC: Correct Syntax for TransferDatabase to dBASE and Paradox

Last reviewed: April 2, 1997
Article ID: Q97519
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0

SUMMARY

Moderate: Requires basic macro, coding, and interoperability skills.

When you attempt to export a Microsoft Access table to dBASE or Paradox, you may encounter errors. This article explains the correct argument syntax for exporting the Categories table from the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0) to dBASE III using the TransferDatabase macro action. The equivalent Visual Basic syntax (or Access Basic syntax in versions 1.x and 2.0) is also explained.

MORE INFORMATION

NOTE: Both of the following examples export the Categories table to a dBASE file in the C:\DBASE folder (directory). You need to enter a valid folder in your macro or you may receive the following error message when you run the macro or function:

   isn't a valid path

Example 1 - Using the TransferDatabase Macro Action

Create a macro named Export1. This macro will export the Categories table to a dBASE file.

   Macro Name     Action
   -------------------------------
   Export1        TransferDatabase

   Export1 Actions
   ------------------------------
   TransferDatabase
      Transfer Type:   Export
      Database Type:   dBASE III
      Database Name:   C:\dbase
      Object Type:     Table
      Source:          Categories
      Destination:     Test1.dbf
      Structure Only:  No

NOTE: To use the TransferDatabase macro action to export to a Paradox table, you must choose "Paradox" for the Database Type argument and enter the Destination argument as "Test1.db".

Example 2 - Using a Visual Basic (or Access Basic) Function

Create a new module and enter the following function:

NOTE: In the following sample code, an underscore (_) is used as a line- continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic.

   In version 7.0:

       Function ExportdBASE ()
         DoCmd.TransferDatabase a_export, "dBASE III", "c:\dbase", _
                  a_table, "Categories", "Test1.dbf"
       End Function

   In versions 1.x and 2.0:

      Function ExportdBASE ()
         DoCmd TransferDatabase a_export, "dBASE III", "c:\dbase", _
                  a_table, "Categories", "Test1.dbf"
      End Function


Additional query words: kberrmsg
Keywords : DcmOthr kbusage
Version : 1.0 1.1 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.