Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle Data control and True DBGrid 5.0

Oracle Data control and True DBGrid 5.0

From: Ing. Martin Gamperl <mgampi_at_ibm.net>
Date: 1998/01/31
Message-ID: <34D32DC1.862BD5D9@ibm.net>#1/1

We are using Oracle Objects for OLE Version 2.1.03.0 within Visual Basic 5.0 (SP3).
To display measured data a True DB Grid 5.0 control is used in conjunction with the Oracle Data control. The grid control was configured to fire the FetchCellStyle-Event for appearance formatting. To increase performance of the FetchCellStyle procedure the use of a clone to the ORADC recordset is recommended (as described in TDBGrid-Handbook).
So we implemented the FetchCellStyle procedure as follows:

Private Sub TDBGrid1_FetchCellStyle(ByVal Condition As Integer, ByVal Split As Integer, Bookmark As Variant, ByVal Col As Integer, ByVal CellStyle As TrueDBGrid50.StyleDisp)
Dim Wert As Single
Dim CRec As Channel
Dim B As Boolean
Dim F As Object

    On Error Resume Next

'#######################################################################

    ORAClone.Bookmark = Bookmark --> this line of code fails !!!!!!!!!!!

'#######################################################################

    If Err.Number <> 0 Then
        Debug.Print Err.Description, CStr(ORAClone.Bookmark),
CStr(Bookmark)
        Exit Sub

    End If

    Set F = ORAClone.Fields(Col)

    If IsNull(F) Then Exit Sub
    Wert = CSng(F)
    CRec = UserData(Me.Tag).Chn(Col - 2)     With CRec

        B = False
        If .VMin < .VMax Then
            If Wert < .VMin Or Wert > .VMax Then B = True
        Else
            If Wert > .VMin Or Wert < .VMax Then B = True
        End If

    End With
    CellStyle.BackColor = TDBGrid1.BackColor     If B Then
        CellStyle.ForeColor = vbRed
        CellStyle.Font.Bold = True

    End If
End Sub

The opening of the recordset, the generation of the clone and the binding of TDBGrid to the data control is done in the form load event:

        .....
        .ORADC1.RecordSource = SQL
        .ORADC1.Refresh
        Set ORAClone = .ORADC1.Recordset.Clone
        .TDBGrid1.Datasource = ORADC1
        .TDBGrid1.ClearFields
        ......

When running the program we always get the error message OIP-04121: Invalid bookmark

Does anyone know what's wrong?
Response with EMail is prefered!

Thanx in advance

Martin


Received on Sat Jan 31 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US