dbSingle, dbDouble: different values from same field 
Author Message
 dbSingle, dbDouble: different values from same field

Hello,

I have a SQLServer 6.5 database with a table ('MyTab') which includes a
DECIMAL(13,2) field - 'MyFld'.
I also have defined a view on the server ('MyView') which also includes
'MyFld'.
I access the database with VB5 DAO via ODBC (evth. works fine so far...)

My problem is, that I get wrong (better: not precise) values - everytime I
use the view:
(Lets say the value in 'MyFld' is 2.54 (verified in I/SQL or Access))

a) Get value from Table
set rs = mydb.OpenRecordset("SELECT * FROM MyTab", dbOpenSnapshot)
d = rs.Fields("MyFld")
--> d = 2.54 'yeah!
--> rs.Fields("MyFld").Type = dbDouble !

b) Get value from View
set rs = mydb.OpenRecordset("SELECT * FROM MyView", dbOpenSnapshot)
d = rs.Fields("MyFld")
--> d = 2.5390003425...   'argh!
--> rs.Fields("MyFld").Type = dbSingle !

Does anybody has an idea?
Workaround ? (at the moment I do round, but can I be sure that the rounded
value is exactly my database value?)

As I am calculating with currencies, I am very dependent on exact values!

Thanks for any information,
Thilo



Mon, 29 Nov 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. dbSingle, dbDouble : different values from same field

2. select box should show values from two different fields from different tables

3. COMBOBOX.BOUNDTEXT VALUE CHANGES TO DIFFERENT FIELD VALUE

4. Fields.Append .CreateField(x, dbDouble)

5. Updating Fields with Different Values?

6. COMBOBOX.boundText value reference change to different field?

7. comparing field values from two different access databases

8. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

9. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

10. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

11. How to display different fields for different groups?

12. FYI: Different result with Multipage1.Value = Multipage1.Value + 1 or - 1

 

 
Powered by phpBB® Forum Software