ACC: Correct Syntax for TransferDatabase to dBASE and Paradox

ID: Q97519


The information in this article applies to:


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          : kbusage DcmOthr 
Version           : 1.0 1.1 2.0 7.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 20, 1999