HOWTO: Use the Remote Data Control to Pass Bookmarks
ID: Q188861
|
The information in this article applies to:
-
Microsoft Visual Basic Enterprise Edition for Windows, versions 4.0, 5.0
SUMMARY
If two RemoteData controls (RDCs) have the same result set, they can use
the same bookmark.
MORE INFORMATION
The following sample uses two forms, each with its own RDC, to demonstrate
that one RDC can use the bookmark set on the result set of another RDC. If
you set a bookmark to the result set of the RDC on Form1, you can use the
same bookmark for the result set of the RDC on Form2. The RDC on Form2
opens the result set and points to the same record that was saved to the
bookmark.
NOTE: Each RDC must have the same SQL property or the bookmark does not
work. Also, each RDC must be bound to the same source in the DataSourceName
property.
Steps to Create Sample
- Open a Standard EXE project in Visual Basic.
- Add a form so that you have Form1 and Form2 in your project.
- Add a RemoteData control to Form1 and another one to Form2.
- Add a TextBox control to Form1 and another one to Form2
- Create a Microsoft Access DataSourceName for the Northwind database in
the ODBC Administrator. Set the DataSourceName property for each of the
RDCs to your Northwind DataSource. Set the SQL property for each of the
RDCs to the following:
Select * From Customers
- Set the DataSource property for each TextBox control to MSRDC1.
- Create a Command button on form1. Paste in the following code:
Private Sub Command1_Click()
Dim varBookmark As Variant
varBookmark = Form1.MSRDC1.Resultset.Bookmark
Form2.MSRDC1.Resultset.Bookmark = varBookmark
Form2.Show
End Sub
REFERENCES
"Jet Database Engine Programmer's Guide," Dan Haught and Jim Ferguson, 756
pages, Microsoft Press, 1997
Additional query words:
kbCtl kbDAO kbVBp400 kbVBp500 kbEEdition
Keywords : kbGrpVBDB
Version : WINDOWS:4.0,5.0
Platform : WINDOWS
Issue type : kbhowto