Thread: BUG #3613: Numeric type problem

BUG #3613: Numeric type problem

From
"jack"
Date:
The following bug has been logged online:

Bug reference:      3613
Logged by:          jack
Email address:      angel911@126.com
PostgreSQL version: 8.2.4
Operating system:   winxp
Description:        Numeric type problem
Details:

Hi All,
I met a numeric type problem,detail :

1.Programe language:vb6
2.Postgresql ole db provider version 1.0.0.2
3.Table jack_test has only one column "salary"( type is numeric(15,2))which
has two records 2.58,3.68.

vb code:
Private Sub Command1_Click()
Dim conn As New ADODB.Connection
Dim rst As ADODB.Recordset
Dim num As Integer
Dim sql As String
On Error GoTo sqlerr
conn.ConnectionString = "Provider=PostgreSQL.1;Password=123456;User
ID=postgre;Data Source=192.168.7.1;Location=BO1;"
conn.ConnectionTimeout = 30
conn.Open
sql = "select salary from jack_test"
  Set rst = CreateObject("adodb.recordset")
  With rst
  .ActiveConnection = conn
  .CursorLocation = adUseClient
  .CursorType = adOpenKeyset
  .Open sql
  While Not .EOF
  MsgBox (.Fields("salary"))
  rst.MoveNext
  Wend
  End With
  Exit Sub
sqlerr:
 MsgBox (Err.Description)
End Sub

When the CursorLocation set to adUseClient results:2,3,
the precision lost.When set to adUseServer resuls:2.58,3.68(right).Is the
problem cause by the ole provider?

Regards,
Jack