VB, MDAC and progress database problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: SST (serge_schmit_at_msn.com)
Date: 01/07/05

  • Next message: JayEs: "Re: Cannot create a row of size x which is greater than the allowable maximum of 8060?"
    Date: Fri, 7 Jan 2005 14:42:11 +0100
    
    

    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


  • Next message: JayEs: "Re: Cannot create a row of size x which is greater than the allowable maximum of 8060?"

    Relevant Pages

    • VB and Progress database with ADO
      ... If the field contains a value ending with a zero, ... I've tried the same things with a C++ program, without this strange problem ... Dim Connection As Object ... Set Connection = CreateObject ...
      (microsoft.public.office.developer.vba)
    • Re: Finding the minimum value in a list but excluding zeros - a variation on an old problem
      ... In your TestFiltereing sub, you use two loop to pick up data excluding 0, but I think you don't need to loop. ... Dim objFunc As WorksheetFunction ... "Filter switched on - minimum zero ?" ... Dim lngCount As Long ...
      (microsoft.public.excel.programming)
    • RE: Function not running inside a Sub when a date field is blank
      ... Basically this function converts a null field to either a zero or a zero ... Likewise for a string field; you can compare to a zero ... Dim db As DAO.Database ... 190 Set fld = db.TableDefs.Fields ...
      (microsoft.public.access.modulesdaovba)
    • Re: Hiding Data points Equal to Zero
      ... macro while applying the formats. ... Dim sr as Series ... I haven't bothered with the code, partly as it will depend on your chart ... but I wonder if you really need to hide your zero value points. ...
      (microsoft.public.excel.programming)
    • Re: Need someone very familiar with arrays
      ... From Les' example, his array started at 1, so I make that assumption in my ... The ReDim at the end is optional, but requires an initial Dim AAs ... If I understand the code correctly, after the first zero is found, the ... Dim temp As Integer ...
      (microsoft.public.vb.general.discussion)