Microsoft KB Archive/97519

= ACC: Correct Syntax for TransferDatabase to dBASE and Paradox =

Article ID: 97519

Article Last Modified on 5/9/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q97519



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



SUMMARY
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 &quot;Paradox&quot; for the Database Type argument and enter the Destination argument as &quot;Test1.db&quot;.

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, &quot;dBASE III&quot;, &quot;c:\dbase&quot;, _ a_table, &quot;Categories&quot;, &quot;Test1.dbf&quot; End Function

  In versions 1.x and 2.0:

Function ExportdBASE DoCmd TransferDatabase a_export, &quot;dBASE III&quot;, &quot;c:\dbase&quot;, _ a_table, &quot;Categories&quot;, &quot;Test1.dbf&quot; End Function

Additional query words: kberrmsg

Keywords: kbusage KB97519

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.