1. Oracle Data control and True DBGrid 5.0
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
---------------------------------------------------
* Ing. Martin Gamperl
* MGS Softwareentwicklung
* Klosterwiesgasse 31/IV
* A-8010 GRAZ
* Tel. : +43-316-83 58 26
* Fax : +43-316-83 58 26
* Mobil : +43-664-40 03 032
---------------------------------------------------
2. Like with Variables and %
3. Help: True DBGrid Control
4. BCP & sa Login
5. GPF using True DBGrid with data control
6. Check constraint using sub-query
7. Can DBGrid be populated with the Recordset and not Data Control
8. ACT! and SQL Server
9. APEX True DBGrid vs. Sheridan DATA WIDGETS DBGrid
10. How to create a control array in the form designer
11. Creating an array of ActiveX controls.