Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: data format problem - VB6 & Informix

    Private Sub disp_Click()
    adodc1.RecordSource = "select t_item, t_dsca, t_stoc from baan.ttiitm001800 where t_item >= '" & Trim$(rm1.Text) & "' and t_item <= '" & Trim$(rm2.Text) & "'"


    Set DataGrid1.DataSource = adodc1

    DataGrid1.Columns(2).NumberFormat = "Standard"

    End Sub

    Actual data in Informix database for t_stoc is 13310, but when it is
    displayed in VB6 datagrid column 2, we get 8.39591932516603E-316,
    another info is that the Informix field is in "float" format.
    We have tried using Scientific, Fixed, General and the results are 0.00.
    Any help will be greatly appreciated.
    Pls help.

  2. #2
    Join Date
    Nov 2003
    You cannot directly access the format, well you can using a Set statement, however the following you might find is a little easier to manage. My example is how to make a column a boolean value with preset true, false, and null values. Hope this helps get you pointed in the right direction.

    'create format variable
    Dim fmtBooleanData as StrDataFormat

    'create new instance of that variable
    Set fmtBooleanData = New StdDataFormat

    'set the type you want
    fmtBooleanData.Type = fmtBoolean

    'set the values or formats if applicable
    fmtBooleanData.TrueValue = "Y"
    fmtBooleanData.FalseValue = "N"
    fmtBooleanData.NullValue = "N"

    'apply those settings to the columns in the grid
    For i = 2 To 4
    Set .Columns(i).DataFormat = fmtBooleanData
    Set .Columns(i).Alignment = 2
    Next i

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts