Microsoft KB Archive/188861

= How To Use the Remote Data Control to Pass Bookmarks =

Article ID: 188861

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q188861



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 </li></ol>

<div class="references_section">