Discussion Locked

Disconnected Recordsets

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can a connect a cisconnected recordset to an existing Grid control. Specifically I'm using the True DB Grid from APEX right now and would like to continue using it because of some functionality I haven't found in other grids. But it requires both a DataMember, and a DataSource in order to bind. Can I mimic this, or should I just try a Different Route?

3 replies

by limbo

You need to create a Public instance of your disconnected recordset, and assign this to your Grid.

Assuming you are using ADO in a class, create a Public property like this.

Public Property Get DataSource() as Variant
Set DataSource = rsPrimary ' your recordset
End Property

Ensure the 'DataSourceBehviour' property of this class is set to 'vbDataSource' at design time.

Now create an instance of the class in the form with the grid, then bind as follows.

Set grdMain.Datasource = ClassInstance.Datasource

And bobs your uncle.

You can expose DataMember in the same fashion, creating an indexed property in the class, which returns the primary recordsets field name property.

by srudolph_

This could work, but it makes the class more complex then I wanted. What I'm doing instead is creating a clone of the recordset to a ADODC control on the form and binding the grid in code.

Thanx for your help
Shawn

This discussion is closed to new replies.