ACC2000: Exporting Currency to Visual FoxPro Produces Double Data Type (241470)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q241470
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

SYMPTOMS

When you use the Microsoft Visual FoxPro ODBC driver in Microsoft Access 2000 to export a table that contains a field with the data type of Currency, the Currency data type is created as a Double data type in the exported Visual FoxPro table.

RESOLUTION

You can use an SQL pass-through query to change the column in the table. The following statement changes the data type of the column to Currency. The letter "Y" in the following syntax is used to denote the Currency data type.
ALTER TABLE tbTestFox  ALTER COLUMN Price Y
NOTE: When you view the table structure in Visual FoxPro, note that the data type is Currency. However, when you link the table in Access, the column data type is Number and the field size is Decimal.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new database in Microsoft Access.
  2. On the Tools menu, click Options.
  3. Click the General tab, and then write down the path that is displayed in the Default database folder box. (You need it in a later step.)
  4. Create a table in Microsoft Access with the following characteristics:
       Table Name: TestFox
       ----------------------------
       Field Name: ItemID
       Data Type: AutoNumber
       Indexed: Yes (No Duplicates)
    
       Field Name: ItemName
       Data Type: Text
    
       Field Name: Price
       Date Type: Currency
    
       Table Properties: TestFox
       -------------------------
       PrimaryKey: ItemID
  5. On the View menu, click Datasheet View.
  6. Type the following three records as test data:
    ItemIDItemNamePrice
    1 Hammer 4.19
    2 Crow Bar 12.00
    3 Drill 55.50
  7. Close the table.
  8. In the Database window, select the TestFox table.
  9. On the File menu, click Export.
  10. Under Save as type, click ODBC Databases at the bottom of the list. Leave the name as Testfox.
  11. In the Select Data Source Dialog Box, click the Machine Data Source tab.
  12. Click New.
  13. Click User Data Source, and then click Next.
  14. Click Microsoft Visual FoxPro driver. Click Next, and then click Finish. The ODBC Visual FoxPro Setup dialog box appears.
  15. Name the new data source TestFox1.
  16. Click Free Table directory.
  17. For the path, browse to the default database folder that you noted in step 3.

    NOTE: If you do not browse to the correct default database folder, the data source generates the following error:
    The Microsoft Jet Database Engine could not find the object "".
  18. Click OK twice. The file is exported.
  19. On the File menu, point to Get External Data, and then click Link Tables.
  20. Under Files of type, click ODBC Databases at the bottom of the list.
  21. Click the Machine Data Source tab, and select the Testfox1 data source that you created earlier. Click OK.
  22. Select the Testfox table that you exported. Click OK. The table appears in Access as Testfox1.
  23. Open the table. Note that the numbers no longer have dollar signs ($).
  24. On the View menu, click Design View. Note the data type for the Price field is Number, and that the field size is Double.

Modification Type:MajorLast Reviewed:11/29/2000
Keywords:kbbug KB241470