Microsoft KB Archive/145608

= PRB: Remote View of 2.x Table Changes Numeric Field Data Type =

Article ID: 145608

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q145608



SYMPTOMS
When you create a remote view based on a FoxPro 2.x table and a numeric field is present, the view will change the data type of the field to a double that defaults to two decimal places.



CAUSE
The field type is determined by the ODBC driver in use.



RESOLUTION
Before the view is opened for a browse, issue the following command: =DBSETPROP('','field','datatype','n(,)') In this example, the  is the name of the remote view and field. The ,  in the n parameters should be replaced with the original field size followed by a comma and then the original decimal places.



STATUS
This behavior is by design.



Steps to Reproduce Problem
 Copy the Invoices table from FoxPro for MS-DOS 2.6 or FoxPro for Windows 2.6 into your default Visual FoxPro directory. Modify a database, and create a new remote view.</li> Select Available data sources, and choose FoxPro Files from the list.</li> When the Open dialog box appears, choose the Invoices table.</li> Choose your fields to display, and then run the query.</li> You should notice that the INO field in the view now has a decimal point with two zeros.</li>  Type the following command in the command window: ?DBGETPROP('remote view name.fieldname', 'field', 'datatype') Notice it returns b(8,2), indicating a datatype of Double. </li>  Type the following command in the command window: ?DBSSETPROP('remote view name.fieldname', ;         'field','datatype','n(4,0)') This will set the data type back to its correct value. </li></ol>

Additional query words: VFoxWin sql

Keywords: KB145608

-

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

© Microsoft Corporation. All rights reserved.