Let's Recap

Visual Studio 6.0

Let's just take a moment to reflect on what we have just accomplished. We created a class module. New with VB 6, we can have the class be a data provider by simply setting the DataSourceBehavior property. VB then automatically adds a GetDataMember sub for us. We can then set up an ADO connection and recordset within the class, build a few properties, and then instantiate the class in a form. Using the built-in BindingCollection, we can add controls to be bound, using our class module as the DataSource of the collection. Not too shabby!

The downside, of course, is that if you want to use something like this in a production environment, you probably need to do more than move forward a single record at a time. We might want to go backwards, edit, add, delete and all of the things that our users might want. Well, let's go to the next step and create our own data control that will actually do all of those things for us.

© 1998 by Wrox Press. All rights reserved.