Jonathan Dodds
Usenet Archive
- Joined
- Mar 16, 2005
- Messages
- 11
- Reaction score
- 0
I'm using ADO from an ASP 3.0 page written in JScript to query a database table in SQL Server 2000. One of the columns in a currency field.
Instead of retrieving a value of 1095.60 like I expect, I'm getting
1095.6000000000001 instead.
If I use other tools like Query Analyzer to run my select the value comes out as I expect.
The type of the ADO field in my recordset is adCurrency as I expect.
Here's a short example of code that demonstrates the problem:
var strSQL = "select ItemPrice from dbo.item where ItemID = 5"; var oConn = Server.CreateObject("ADODB.Connection"); oConn.Open(getDBConnectionString); var rs = oConn.Execute(strSQL); while (!rs.EOF) { Response.Write(rs("ItemPrice").Value + "<br>"); rs.MoveNext; } rs.close; oConn.close;
Am I doing something wrong here?
My DSN shows
Microsoft SQL Server ODBC Driver Version 03.85.1025
Is there a driver problem?
Instead of retrieving a value of 1095.60 like I expect, I'm getting
1095.6000000000001 instead.
If I use other tools like Query Analyzer to run my select the value comes out as I expect.
The type of the ADO field in my recordset is adCurrency as I expect.
Here's a short example of code that demonstrates the problem:
var strSQL = "select ItemPrice from dbo.item where ItemID = 5"; var oConn = Server.CreateObject("ADODB.Connection"); oConn.Open(getDBConnectionString); var rs = oConn.Execute(strSQL); while (!rs.EOF) { Response.Write(rs("ItemPrice").Value + "<br>"); rs.MoveNext; } rs.close; oConn.close;
Am I doing something wrong here?
My DSN shows
Microsoft SQL Server ODBC Driver Version 03.85.1025
Is there a driver problem?