
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