ComponentOne List 8.0 for ActiveX
BookmarkType Property

 

True DBList Reference> TDBList Properties> BookmarkType Property

BookmarkType Property

Sets/returns the variant type used for passing bookmarks.

Syntax

object.BookmarkType= integer

Remarks

Read/Write at run time. Not available at design time.

Property applies to TDBList and TDBCombo controls.

The BookmarkType property returns or sets the variant type of bookmarks returned by a TDBList and TDBCombo control through its properties, methods, and events. You can use this property to ensure that the control conforms to the bookmark type expected by a bound data source, including ADODC and RDC controls. This property is used only in bound mode and has no effect in unbound or storage modes.

In some cases, the bookmarks returned by the control are incompatible with the ADO Recordset object exposed by an OLE DB data source, even though the control uses the same bookmarks internally to retrieve and modify data. For example, code such as the following may generate a type mismatch error:

ADODC1.Recordset.Bookmark = TDBList1.RowBookmark(0)

You can use the BookmarkType property in conjunction with the RowSourceChanged event to circumvent type mismatch errors that may occur when a control-supplied bookmark is passed to an ADO Recordset object (or vice versa). The workaround is as follows:

Sub TDBList1_RowSourceChanged()

    TDBList1.BookmarkType = VarType(ADODC1.Recordset.Bookmark)

End Sub

This code ensures that any bookmarks returned by the control are first converted to the appropriate type for the bound data source. This workaround is only needed when using the control in an HTML page; it is not needed for Visual Basic 6.0.

See Also

TDBList and TDBCombo Controls

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback