InformationWeek: The Business Value of Technology

InformationWeek: The Business Value of Technology
InformationWeek - Our New iPad App

News In Review

November 24, 1997

Data Control Alternatives For VB

Sybase, Sheridan offer replacements for link between ActiveX database, form controls

By Andy Feibus

T he toolbox of ActiveX controls included with Microsoft's Visual Basic provides an easy way to create data-bound forms in your applications. But, as with many Microsoft technologies, if you want to do something complex-like provide easy searches or master-detail forms-you either have to write a lot of code or go find another toolbox.

Replacements for the data-bound controls are available from a number of ActiveX control vendors. But there are few replacements for the data control-the conduit that links your database and the controls in your form. Sybase Inc. and Sheridan Software Inc. are addressing this need.

Sybase's Visual Components dbComplete provides a data control replacement, while Sheridan Software's Data Widgets includes a component that enhances the standard data c ontrol in similar ways. You'll also find a few interesting data-bound controls with each of these products.

If you're simply unhappy with your combo-box control or text box control, you really have no reason to use these products. But if you want a data control that lets you search for records, bookmark them for quick retrieval, or create master-detail forms without additional code, then one of these products may be in your future.

For this review, I evaluated dbComplete 1.5 and Data Widgets 2.0. Data Widgets 2.0 cannot be directly printed but can be used in your applications and in a Web page. dbComplete provides the ActiveX controls you will use in your applications and lets you print them and use them in a Web page. Sybase provides no information on how to embed these controls in a Web page, in effect discouraging their use in the Web environment.

dbComplete
Sybase's dbComplete is a set of seven data-bound controls and one awesome data control. The data-bound controls include a che ck box, an option group, a masked input field, a combo-box, a calendar combo-box, a picture combo-box, and a hierarchical grid.

The check box is different from the standard check box in that the "checked" and "unchecked" values do not need to be the Boolean TRUE and FALSE, but can also be any number or value, such as 25 or "Male." For situations when your database cannot store TRUE and FALSE, this flexibility saves you coding time.

The combo-box, masked input, and option group controls are similar to the controls included with Visual Basic, except they provide more formatting control and are easier to configure. For example, if you want your combo-box to list the states and their abbreviations, the standard combo-box control's unfriendly user interface for specifying lists wastes valuable time. With the dbComplete combo-box, you enter these values into a data grid.

The picture combo box lets you display not only character string choices, but also pictures. These pictures can be in JPEG (Joint Phot ographic Experts Group) format, Windows Metafile, or Windows bitmaps. If you bind this control to a data source, your database must support large binary columns that can hold these pictures in one of those formats.

The calendar combo-box provides a masked input field for entering and displaying dates. On the right-hand side of the edit box is a button to click if you want to pull down a calendar in order to choose the date you want. This functionality is similar to what you will find with most calendar controls. What's interesting with the dbComplete calendar combo-box is that you not only can control how the calendar is displayed-how many weeks to show, or how the selected date is highlighted-but you also can programmatically assign help balloons to certain days. For example, if you use this control in an online scheduling program, you may want to attach a help balloon to company holidays so that those days do not get inadvertently picked.

The dbComplete data grid provides a way for you to hierarchic ally display your data. Think of an expandable outline of your data, where each level can be bound to a table or a view related to the next higher level in the outline. The dbComplete grid also lets you create summary lines, computations, and unbound data fields into which you can programmatically assign values. The only problem I had with the grid is that during design time, I had to insist that the grid expand all levels to see the way the grid will be displayed during run time. Otherwise, you see only the top level of the grid and have to actually run it to see how it will look later.

Each field of the grid can also be changed from a text field to any of the other dbComplete components, such as a combo-box, option box, or check box. At design time, you can also decide to let users add, delete, or update records from within the grid on a level-by-level basis. Overall, though, only changing records from within the grid seemed like something that I would want to explain to an end user. The other operation s seemed too complicated for all but the most sophisticated end users.

The real gem of the package is the data control, which not only lets you move between records like the standard data control but also lets you search for records based on information you provide and bookmark records for quick retrieval. You can also cascade these data controls to create master-detail forms. Just set the master data control to the table or view you want to use and then create another data control that references the master data control but views a related table.

The dbComplete data control also provides an easy-to-use set of dialog boxes so you can choose the tables and fields to extract for your data control. For example, I can use the design-time dialog box to pick the customers and orders tables, select the fields from these tables, and select the sort ordering for the resulting join. This information is then used by the data control to create the SQL request for the database.

However, the resulting SQL is v ery slow when compared to the "expert mode," which lets me specify the exact SQL statement. For example, using the dialog boxes to create a simple join between two tables required more than 30 seconds to load all 6,500 resulting records into a simple data grid. Using the equivalent SQL statement required only 11 seconds to load the same records. Single-table data controls did not exhibit this problem, so consider writing your own SQL statements if you want the best database performance for queries with joined tables.

Data Widgets
Like dbComplete, Data Widgets is a set of data-bound ActiveX controls and an enhanced data control. Data Widgets data-bound controls include a data grid, a combo-box, an option group, and a command button. You also get what Sheridan calls a "Data DropDown" control, which is just a way to specify a combo-box for a column of your Data Widgets data grid. Overall, the range of features available with Data Widgets is significantly less than what you get with dbComplete, bu t for many tasks, you may find Data Widgets' features to be all that you need.

Sheridan's data grid lets you graphically lay out your grid so that you can have multiple lines for each record, odd/even record shading for easier viewing, and column-by-column coloring and font control. Each grid column can be a text edit box, a check box, a combo-box, a button, or a picture. The combo-box can be only a single-column static list that you create at design time using a simple dialog box. The check box supports only TRUE and FALSE values. With the button, the value of the field is the button's caption. To make the button useful, you must add your own code to be executed when the button is clicked. While you can display a picture in a cell, you can't use any of the data-binding features of the grid to make it happen.

If you want to use a data-bound combo-box control for a grid field, you must add a Data DropDown control to your form and, using code that initializes your grid, create a link between the Data Dr opDown control and the grid column. This is the only use for the Data DropDown control, and it seems silly that you have to add another control to your form and add code to your application to provide a data-bound combo-box control in your data grid.

The combo-box and option group controls are similar to their respective counterparts in dbComplete. The Data Command button provides an easy way to perform database actions without any code. Just insert a Data Command button into your form, specify the name of the data control and the database action to perform, and you're done.

The possible database actions include: going to the first or last record, going to the previous or next page (the size of the page is determined by a control property), going to the previous or next record, saving a bookmark, going to a bookmark, and refreshing the data control's data.

For many end users, having a properly labeled button is much better than having a data control at the bottom of the form with those strange l eft- and right-arrow icons.

The Enhanced Data Control (EDC), like the dbComplete data control, is the real find in this package. Unlike the dbComplete data control, however, the Sheridan EDC is not really a connection to your data, but an enhanced user interface for the standard data control bundled with Visual Basic. The standard data control provides buttons to move to the first or last record in the data set or to the previous or next record in the data set. The Enhanced Data Control lets you do all this, plus it adds database actions, searching, and bookmark capabilities. In addition, although the default EDC has those strange icons to indicate the button's actions, you can replace the icons with your own graphics if you like.

The EDC's search features are the best part of the product. Not only can you search on any column in the data source, you can also use the "find" dialog box to specify the comparison type (less than, greater than, and so forth) and comparative value. You can also do a Soun dex search, which lets you search for matching strings that sound like the comparison string you enter.

From the EDC, you can bookmark the current record, go to any of 100 bookmarks that you've selected for the data set, or clear all the bookmarks. The Sybase product has the better interface, since it also lets you bookmark every record in the data set matching a particular piece of information (such as EmployeeID = 4), and it doesn't limit the number of bookmarks you can create for your data set.

The EDC database actions that you can perform from the EDC are add, delete, save the updated record, and cancel the added record. Many database programmers will create forms with special command buttons to perform these same tasks.

Of the two products, dbComplete provides the better set of features for the money-namely, the grid and data control features. But if you need the added search capabilities that Data Widgets provides, get that as well. Your applications will win lots of applause.

Andy Feibus is president of CustomBytes, an Atlanta software development consulting firm. He can be reached at amf@mindspring.com .


Back to News in Review

Send Us Your Feedback

Top of the Page


Get InformationWeek Daily

Don't miss each day's hottest technology news, sent directly to your inbox, including occasional breaking news alerts.

Sign up for the InformationWeek Daily email newsletter

*Required field

Privacy Statement



This Week's Issue

Supplemental Issue

Related Whitepapers

Related Reports

Related Webcasts






Video