VB and Progress database with ADO

S

SST

Hy!

I've a strange problem when reading an integer value from a table in a
progress database.
If the field contains a value ending with a zero, (ex.: 24580) the value
that my VB code returns to me is without the significant zero (ex. 2458).
I've tried the same things with a C++ program, without this strange problem
(thanks C++ :) ).


Here is my VB Code
------------------------
Sub Test_Compteur()
'
Dim Compteur As Object
Dim Connection As Object
Dim Record As Object

Dim connString As String
Dim ID As Long


' I know that the result is 248150
'
sqlStr = "select MAX(Volgnummer) from Prive_Persoon where Firma_Code =
'ana'"

Set Connection = CreateObject("ADODB.Connection")

Connection.Properties("Password") = "pby"
Connection.Properties("User ID") = "PBY"
Connection.Properties("Data Source") = "dima_test"

Results = Connection.Open

Set Record = CreateObject("ADODB.Recordset")
Results = Record.Open(sqlStr, Connection)

If Not Record.EOF Then
Value = Record.Fields(0).Value
End If

'I received 24815 as Value
Results = MsgBox(Value, vbOKOnly)

'Set Compteur = CreateObject("DimasysDal.Compteur")
'idAdress = Compteur.NextIdPersonne
'Set Compteur = Nothing

Set Record = Nothing
Set Connection = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top