PRB: Negative Values Put in Remote View Rounded Up in SQL Server Table (216955)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Data Access Components 2.5
This article was previously published under Q216955 SYMPTOMS Negative values inserted into numeric fields of remote
views of SQL Server tables are rounded up by 0.01. RESOLUTION There are three alternative resolutions for this issue:
- Install the 3.70 ODBC driver.
- Set the DataType of the numeric field of the remote view to
"Y" (currency) as in the following example:
=DBSETPROP('testview.mykey','Field','KeyField',.T.)
=DBSETPROP('testview.mykey','Field','Updatable',.T.)
=DBSETPROP('testview.mykey','Field','UpdateName',lcsysdbo+'myKEY')
=DBSETPROP('testview.mykey','Field','DataType',"C(12)")
=DBSETPROP('testview.myamt','Field','KeyField',.F.)
=DBSETPROP('testview.myamt','Field','Updatable',.T.)
=DBSETPROP('testview.myamt','Field','UpdateName',lcsysdbo+'myamt')
=DBSETPROP('testview.myamt','Field','DataType',"Y") - Use SQL Pass-through commands as in the following example:
sqlcommand="INSERT INTO testamount (mykey, myamt)" + ;
"VALUES ('" + m.cmykey + "', " + STR(0-m.nnumber,6,2) + " )"
=sqlexec(gnconnhandle,sqlcommand)
Modification Type: | Major | Last Reviewed: | 10/29/2003 |
---|
Keywords: | kbDatabase kbprb kbSQLProg KB216955 kbAudDeveloper |
---|
|