PRB: View Designer Sets Decimal Places to 3 for Double Data Types (275863)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q275863

SYMPTOMS

When you create or edit a view using the View Designer, the number of decimal places for data types mapped as Double data type is set to 3 under the Fields Data Mapping property.

RESOLUTION

Use the DBSETPROP() function to set the number of decimal places for the field:
DBSETPROP('MYVIEW.MYFIELD','FIELD','DATATYPE','B(5)')

MORE INFORMATION

This is a display anomaly in the View Designer. Views that map fields to a Double data type will be displayed as defined.

Steps to Reproduce Behavior

  1. Create a program file named Vfpview.prg and paste the following code:
    IF !FILE("FLOTDEMO.DBC")
       CREATE DATABASE FLOTDEMO
       CREATE TABLE FLOATER (ident i PRIMARY KEY NOT NULL, dblfld b(5) NOT NULL)
       CREATE SQL VIEW FLOTVIEW AS SELECT * FROM FLOATER
    ELSE
       OPEN DATA FLOTDEMO
    ENDIF
    *!* Explicitly set the number of decimal places to 5.
    =DBSETPROP('FLOTVIEW.DBLFLD','FIELD','DATATYPE','B(5)')
    MODI VIEW FLOTVIEW
    					
  2. Save and then run Vfpview.prg.
  3. When the View Designer appears, click the Properties button.
  4. In the View Field Properties dialog box, select floater.dblfld.
  5. Note the decimal value displayed under Data Mapping.

REFERENCES

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by John Desch, Microsoft Corporation.


Modification Type:MajorLast Reviewed:8/27/2002
Keywords:kbCodeSnippet kbDatabase kbDesigner kbDSupport kbprb KB275863 kbAudDeveloper