By William LaMartin, Editor, Tampa PC Users Group
I have used Visual Basic since version 1, missing only one version update along the way, I think. I need to see a need to update, like a collection of new and useful tools. At first Version 6 didnt seem to offer that much in the way of an improvement over Version 5, so I programmed along happily with Version 5. And quite possibly if you are not interested in improved database connectivity or Dynamic HTML, you would gain nothing from upgradingexcept that an upgrade to Version 6.0 should solve all of the problems some of us have with incorrect versions of some of the VB controls creeping into our computers.
Many of you will recall my writing in this newsletter about problems caused by programs I installed overwriting certain OCX files (the ActiveX VB controls) on my computer, resulting in VB not being able to use the controlor I couldnt get help for the control. The solution was to unregister the control, delete it, find the correct control, copy it to the hard drive and then register it. It happened so many times I got fairly good at the routine. With VB 6 on my computer this problem should go awayuntil VB 7 is released, causing problems for VB 6.
Another advantage of VB 6 would be the correction of many problems in VB 5 without the use of service packs. I think I was up to service pack 3 on VB 5. There are service packs for VB 6, but they dont seem as necessary.
With the above in mind and the promise of improved database tools like being able to create data reports in VB (like Microsoft Access reports), I installed VB 6 on my desktop computer. At least I tried to install it. Everything went smoothly until the end of the installation when I received the two messages, "The version of resource DLL MSDASQLR.DLL is not valid" and "MSDASQL.DLL was unable to register itself in the system registry". Such problems seem to plaque me. It is the persistent problem of different versions of DLLs.
I looked at these files on my computer and the files appeared the same as on the installation CD. To try again, I renamed the offending files so the installation wouldn't see them and ran the installation againwith the same result. Time to try another tack. I searched Microsofts Knowledge Base and found only that the files had to do with Microsoft Data Access Components. I then checked my laptop and found newer versions of the same files. After copying them to my desktop, the installation went fine. I cant explain it other than to guess that these newer versions were on my desktop before the installation (having been put there by some unknown piece of software) and registered in the registry, then the installation replaced them but was unable to subsequently register the files it had replaced them with. I dont really understand the registering of DLLs, etc, other than you do it with the program REGSVR32.EXE and that I seem to have an inordinate number of problems with incorrect DLL and OCX versions.
Anyway the problem was solved, and VB 6 was installed. So what can I do now that I couldnt do before? First, let me tell you about what you can do in Visual Basic, in general, then I will address what version 6 has added.
With VB I have written programs to:
VB is a great tool, but you have to use it in order to learn itsomething I stress in our VB SIG. In fact, there is also a learning edition of VBmuch cheaper than the VB Professional version I am writing aboutthat I am endeavoring to get a review of out of one of the SIG members who is using it. I recommend a beginner purchase this first to see if they really have a taste for VB before investing over $400 in the Professional Version.
VB is object oriented and event driven. It is nothing at all like your old BASIC programming tool. The code you write to go along with an event is, however, similar to code you would have used in BASIC. Everything in VB is an object, and an object has properties, events and methods associated with it. A VB program starts with a form (itself an object with properties, events and methods). On that form you may place other objects which are called controls, e.g., a text box, list box, command button, or timer.
The following screen capture is of a form with a text box and command button showing, and a Timer control that is hidden.

The text "Thanks" in the text box is the result of pressing the command button. This is called the click event for the button, and its associated code is the simple subroutine:
Private Sub Command1_Click()
Text1.Text = "Thanks"
End Sub
So by causing the click event for the button object we changed the text property of the text box object. The time and date printed across the bottom is actually a label whose caption property is changed every second (a timer event) to reflect the current date and time.
So in this very simple example, a timer (which is an object) event causes via the code below the caption property of the label object to change to the current date and time.
Private Sub Timer1_Timer()
Label1.Caption = "The date and time are " & Now
Label1.Refresh
End Sub
A full grown VB program will have numerous forms, with each form having numerous controls. To achieve the goal of the program you will have to write code for the various events that performs the manipulations and calculations needed.
One goal of VB 6 is to reduce the amount of code you have to write to interact with databases. To accomplish this it has added several new items: the Data Environment, Data Reports and a VB Data Form Wizard. See the screen shot below for the Project Explorer display of these new items.

The Wizard will create a form containing a data grid displaying a table from your chosen database along with buttons for updating, adding, deleting, etc. the records. The Data Environment is a bit more complicated. It allows for creating several data connections and within each connection you set up various "Commands" corresponding to the tables or queries in the connection. Each Command can have child commands. The goal is to set up your commands (tables/queries/SQL) so that VB can then create a Data Report based on a command and its child commands that will resemble what you could do with reports in Microsoft Access.
This is a nice addition. Such reports could not be created in VB 5, and it is at least 50% of my reason for upgrading. My problem at present is to get these VB Data Reports to do what I can get such reports to do in Access. If I make my report a little complicated it doesnt turn out as plannedfor example, two levels of grouping of the report data. I assume this is due to my ignorance, and that, as with Microsoft Access, I will eventually learn how to accomplish the desired results. What is frustrating is the lack of examples in Help (only one. and it doesnt go far enough) for doing the type of thing I want to do.
VB Help, in general, is quite good, and you are going nowhere with VB if you dont learn how to use it, but it seems to fall down as concerns the Data Reports, as it did with the Internet controls in VB 5. As an aside, I originally moved up to VB 5 to gain the ability to access WWW and FTP sites with VB programs. As regards the Help format, it is now like viewing a web page. What I dont know yet is if VB 6 includes a tool that will allow you create this new type of Help file for your own project. At present, I think not.
Finally, VB 6 enables you to create Dynamic HTML applications. DHTML applications allow you to write Visual Basic code to respond to actions on an HTML page without transferring processing to the server. There is only one drawback with DHTMLyou must be using Internet Explorer 4.0 or higher as you browser to view the pages. They will not work with Netscape Navigator. So I may create some pages and post them on the WWW as an exercise but not as an essential part of a web site. They would be useful, however, on an Intranet where everyone was using the Microsoft browser.
For the beginner, Visual Basic is a great product but dont expect to become proficient with it without a lot of hard work. For the seasoned user, move up to Version 6 if my comments make it compelling for you to do so. u