Scott's Column
VB & The JukeBox

February 1, 1998
By Scott Lewis

It has been an interesting month for me. For starters, if you read last months column, you know I received a Sony 200 Disc CD Changer for Christmas. Called The JukeBox, this machine will hold up to 200 CDs. However it will only allow you to program up to 32 songs. So it was time to circumvent this shortcoming with some programming of my own. Read on for how I did this. Also this month I tell you about Sound Blaster's new Encore DVD drive. And more of the usual stuff. Enjoy.

JukeBox 1.0

With the release of this column I am putting out the first version of JukeBox, a CD cataloging program I wrote in Visual Basic. You can download the program from my Downloads page. Basically, the program uses an Access database to store the information about your CDs. I also added special features that support a CD collection that is stored in a juke box style CD changer.

Some of the features to support The JukeBox are:

  1. You can designate each CD with a preferred status of always, sometimes, occasionally, or never. This information can be used to help the application select songs for you to put into your CD changers program list.
  2. You can designate each song with the same preferred status as the CDs. This is more important for letting the application build a play list for you to enter.
  3. You can tell the application what slot in your CD changer the disc occupies. This is required for getting the a list of disc numbers and track numbers to enter in your play list.

JukeBox can store as many CDs as you like. I have created data entry screens for entering the names of groups or artists, categories for the music, and the CDs themselves. Even if you don't have a CD changer, this application can still be used to catalog your collection. I have a number of reports that you can run, as well as the ability to print an instruction sheet for programming a Sony CD changer. (I can add other brands easily, just send me the instructions from the manual and I can duplicate them in my application.)

I have decided to supply multiple databases for your use. Included in the download are three database files. JukeBox.mdb is an empty database that is ready for you to enter all your information. I have enclosed Artist.mdb and Full.mdb. The Artist database contains all the artists and categories I have entered into my own database. This might ease your own data entry. Finally, the Full database contains everything I have entered (at the time I built the distribution). This database might be easier for you to use if you like classic rock and roll as much as I do. I might be easier for you to start with my list and delete the CDs you don't have.

It will be up to you to copy the correct database file to the directory that JukeBox.exe resides. The database that the program uses must have the filename JukeBox.mdb. Good luck if you use my collection as your start.

At present, some of the reports are not fully functional. Also, printing is very crude. This is the first VB application that I have programmed to do any printing in over 4 years. Last time was with VB 3.0. We had a library of routines to ease coding the printing, and make to output look really good. I decided not to recycle that old code, but start from scratch. I plan to polish the print routines, and add some extra features in the near future.

Feel free to download the program. Make sure you download the Visual Basic 5.0 run-time library as well. You will need to install the run-time library before installing JukeBox 1.0. Please feel free to let me know of any bugs (yea, like I make any mistakes), or enhancements you would like. I will add them to the list of work to do on the application for version 1.1, which will have the printing improvements.

Troubles And Other Stuff With VB

Here is a little piece of advice for VB programmers. It may apply to other languages as well. Do not install VB 4.0 & VB 5.0 on the same computer.

I have been programming with Visual Basic since version 1.0. I never did anything worthwhile until VB 3.0. In fact, my experience with VB 1.0 was that it was a toy. VB 2.0 was better if you had the professional edition with the custom controls. I actually learned VB programming using VB 2.0, but still had yet to create an actual application. Then VB 3.0 came out with its built in Jet database support. After playing with the database capabilities of VB 3.0 I wrote my first real live VB application. It was a port of an Oracle 6 (I know 7.3 is the thing now) application running on a VAX/VMS system. I was programming this on a 386/20Mhz, just to give you a feel for how long ago this was.

I found that most of the built in features of VB's database commands were either way to slow, or would not work at all. Many of these were in searching though thousands of records in complicated tables with one-to-many relationships. (A one-to-many relationship is were you have multiple records in one table that relate to only one record in another table. Take my JukeBox program. The titles for the CDs are in a table, and each title has one record. Each song, however, has many records in another table that relate to the one record in the table with the title of the CD.)

I programmed all my own search and query routines. I spent a couple of months in my spare time getting the application to perform as fast as the original Oracle 6 - VAX/VMS application. When it was done, we ported the application to a brand new 486/33MHz machine. It ran circles around the Oracle application, and had more features.

Onto VB 4.0. I have been lightly programming in version 4.0 of Visual Basic. To help learn the nuances of VB 4.0 I decided to finally write my AddressBook. I kept the application simple (as intended). Now it came time to write JukeBox. I have VB 5.0, so what to do? I have not even used VB 5.0 since it was installed. Since I wanted to get JukeBox up and running quickly, I decided to use VB 4.0.

Everything was working fine, until I transferred all the files for the project to another machine that only had VB 4.0. VB 4.0 could not load any of the custom controls listed in the project. The problem boils down to this, the computer that I started the application on has VB 4 & VB 5. All the custom controls from VB 4 were replaced by the controls from VB 5 when it was installed. VB 4 could not load non-existing VB 5 controls. I ended up with a hybrid VB 4/5 application. This would make distributing the application a nightmare, so I upgraded the application to VB 5.0.

A word to the wise, don't assume you can have multiple versions of the same software running harmoniously on the same computer. Especially development tools. Because of this, I made the jump to VB 5.0 in full. I am putting the final touches on AddressBook 1.1 using VB 5.0, and should have it ready shortly after you read this.

Since I was going to another application number (1.1) I decided to add a feature that I had previously tested. I was programming my client server application at work, and needed to launch the default web browser. I had trouble launching an application's executable without knowing in advanced what it was. I tested developing this code using AddressBook, and now added the ability to launch your e-mail client to send a message, or to go to a persons home page. This feature required using Windows API calls.

Sound Blaster's Encore DVD

My brother-in-law invited us over for Superbowl Sunday. He has a Sony 43" Projection TV and thought we would enjoy the game. It was fun with family and a couple of stray friends. But better than the game (especially since my cheese heads lost) was that he had a new DVD player. Get this, he got the Sound Blaster Encore DVD player for one of his computers, and connected it to his TV. It is really cool. The picture quality to the TV was excellent. The PC is a Pentium 133 and ran the movies in a window or full screen. In a window (about 3/4s the size of his 1024x768 15" monitor) the picture quality was very impressive, a little better than the TV, only smaller. At full screen it seemed a little less clear and didn't quite match the quality of the TV. All in all, an excellent setup. Cheap too. I have yet to see a DVD player priced below $500 in a store, but the Sound Blaster Encore setup is $350. Finally I can start to recommend DVD. My brother-in-law says the Encore is supposed to also play Sony Playstation Disc. He did not get a chance to test this out yet. I'll let you know.

Site Of The Month

This month's Scott's Site Award goes to The Straight Dope. A friend of mine lent me the book The Straight Dope when I was going on vacation in England, and taking a military hop. For those civilians out there... a military hop is a lot like flying standby, only worse. You sign up for a flight out, and wait around for a plane going your way. Problem is, many military aircraft don't have much passenger space, and they don't have regular flight schedules. It took me two days sitting in passenger terminals to get to England. Total cost was $50 though. (Free from Kelly AFB, Texas to Andrews AFB, Virginia; free bus ride from Andrews to Dover AFB, Delaware; $35 for a civilian bus from Dover to the Philadelphia International Airport; free military pickup shuttle to McGuire AFB, New Jersey; 5$ for a one night stay at McGuire's billeting, essentially a hotel, and $10 for the box lunch on the flight from McGuire to Lakenheath RAF, England; lodging in England was also free since I was staying with my oldest friend in the world) During all this time, I almost read the entire book. When I got back to the states I looked for a copy of the book for my mother, and low and behold, discovered More Of The Straight Dope. I bought two copies, one for my mother and one for me.

Oh yea, Site Of The Month. As luck would have it, The Straight Dope has a web site. I remember looking for it a couple of years ago, and only found an unofficial one that was no longer being updated. Now we have the real thing. For those not familiar with The Straight Dope, let me explain: The Straight Dope started out as a newspaper column for a paper in Chicago (I don't remember which). The basis for the column was that Cecil Adams, the columnist, would answer any question asked by his readers. Well this snowballed into one of the most unusual question and answer columns known to man. Some questions border on insanity, and other are ones that most people would never think to ask, but always wanted to know. Well Cecil answers them. Cecil's writing style and incredible attitude toward the subject matter are a joy to read anytime. I give The Straight Dope my highest recommendation. Get the books (there are three now with the release of Return Of The Straight Dope), and visit the web site. You will not be disappointed.

Book Of The Month

I have not had a chance to go shopping for books recently, so I will recommend Return Of The Straight Dope. I have looked for it a couple of times, but no luck. I may have to go online and order it. This is the third book in The Straight Dope series. I have the first two, and will get this one. Highly recommended.


Well that does it for this month. I have no idea what I am doing next month, so just tune in. I am going in for sinus surgery on Jan 29. This means that these pages will be uploaded while I lay recovering. Hopefully I won't have any serious complications that prevent that. I will let you know how surgery went next month. Have fun cataloging your CD collection and loading your CD changer.