Learn To Program Objects With Visual Basic 6
Muska and Lipman Printing
Errata and FAQ's
Every author endeavors for perfection. My apologies for the typos that have slipped
through. We'll do our best to have these corrected for the next printing.
Error--call John Smiley
This happens when you copy the completed China Shop
Project (either the one on the CD or one you downloaded somewhere) to your hard
drive and try to run it. The reason for that is that the program is 'hard coded'
to run from only one location (you'll learn how to fix this in the Objects book
using the Path property of the App object).
At any rate, the program can only run from this
so make sure you copy the files there. Any other
location will cause this problem. And after you copy the files, make sure they
are NOT marked Read-only--something that happens when you copy from a CD.
General #2---Copied Files are read only
Not an errata, but ...
If you copy the sample files from the enclosed CD-ROM to your hard drive,
most likely they will be marked read-only.
When you try to access the China Database, you'll receive an
error message that reads
The Microsoft Jet database engine cannot open the file "C:\VBFiles\China\China.mdb".
It is already opened exclusively by another user, or you need permission to view its data."
To fix this, all you need to do is open up the Windows Explorer, select the China Shop Database,
then right click your mouse to bring up the Properties Window. Un-check the read-only attribute, and you
should be fine.
General #3---Word 2000
Not an errata but..
I recently received this email from a reader---many thanks, as he answered
a question that has been troubling several readers
I ran into a problem while
working through your Learn to Program Objects with Visual Basic 6 book.
It has to do with creating Word applications. I used about every
variation imaginable to create the Word.Application object. Everything I
tried resulted in the same error message, "Error: 429, ActiveX component
can't create object". I should mention that I'm running
Office 2000 on a Windows 2000 machine.
I spent days trying to figure
out what was wrong. I tried re-installing Word, replacing MSWORD9.OLB
(the Microsoft Word 9.0 Object Library file), downloading an Office Registry
Repair utility from Microsoft (which interestingly, worked twice before giving
me the error message), everything I could think of. Then I ran across
someone else who had encountered a similar problem in one of the newsgroups.
As it turns out, the problem occurs when you also have Norton Anti-Virus
running. I had to unregister NAV (regsvr32 /u "c:\program files\navnt\officeav.dll"),
then everything worked fine. What a relief!
thought I'd pass this along in case you get any inquiries from students
experiencing similar problems.
General #4--Error Handler in original code
There's a bug in the Error Handler for the load procedure of the main form.
If the PRICES.TXT file is not found, we detect it properly, but we
wind up generating a cascading form load event. To correct that, you need to follow these steps
in the Load Event Procedure of the Main form.
After executing the line of
code reading 'Unload frmMain' we should also execute the 'End' statement. Like this:
- Page 36. "Dorothy" should read "Rachel"
- Page 49, highlighted box. "http"//www.omg.com" should read
- Page 49, line 13. "model of that we create of ..." should be
"model that we create of ..."
- Page 51, Paragraph 4, Line 3. "we we've written" should be
- Page 58, Paragraph 4, Last Senetence. "Word is the way to"
should be "Word is the way to go."
- Page 84, last paragraph, first line. "where the of the top" should be
"where the top"
- Page 88, 2nd sentence. "Let me make this by clearer by" should be "Let me
make this clearer by".
- Page 91, 1st paragraph - 1st sentence. "That's spot on," should be
"That's right on,"
- . Page 91, 1st paragraph - last sentence. "able to able to reflect" should
be "able to reflect".
- Page 124. The syntax for the ADD method reads as follows:
Add (Item As Variant [, Key As Variant], ...
It should be...
Add (Item As Variant [, Key As String], ...
- Page 143, Step 2, screenshot. It doesn't really matter, but there is
a space after "Corelle" and the number 4, and after "Faberware" and the
- Page 147, first new line of code. strBrand is declared, assigned the
selected item in the textbox, but then never used again.
The code was going in the right direction---
assigning the text property to a variable and using the value
of the variable in the comparison expression for each of the
If statements is more efficient code--
as each 'read' of a property requires two Input-Output operations.
Looks like I started to do that, and didn't follow through.
- Page 160, First paragraph, First line. "chill" should be "chilly"
- Page 160, last paragraph, 2nd sentence -
"objects in you program" should be "objects in your program".
- Page 161, last paragraph, 1st sentence -
"So can the Visual Basic system objects can be regarded as system properties?"
"So can the Visual Basic system objects be regarded as system properties?"
- Page 162, Paragraph 7, Line 4. "it's" should be "its"
- Page 167, Paragraph 4, Line 2. "it's" should be "its"
- Page 178, steps 2 and 3. If App.Path = "\" should be
If Len(App.Path) = 3. The Len function returns the length of a string,
and the length of the Path property will ONLY be 3 if the path is the
- Page 180. The Path property will actually return "C:\" not "\"
- Page 183. The list of "vbCF..." constants does not contain the
"vbCFRTF" constant for Rich Text that is used in the example on page 184.
It is also not listed in the "GetFormat" section of the MSDN Library,
though it appears in the "Clipboard Object Constants" section.
- Page 205, 2nd paragraph - "I could see Rhonda smilingly nervously." should be
"I could see Rhonda smiling nervously."
- page 206, 5th paragraph, 2nd sentence -
"... Printer Dialog box, and let the user to change ..." should be "... Printer
Dialog box, and let the user change ..."
- Page 206, Last Paragraph, Line 3. "every printer installed on PC"
should be "every printer installed on the PC"
- Page 212. The picture in the text of the design view for the
Fonts Property example does not match the run-time shot on page 213.
- Page 213, paragraph beginning "Because the Fonts...We can use the"
should read "Because the Fonts...We cannot use the"
- Page 217, In the table, "VBIconPointe" should be
- Page 235, Paragraph 4, line 3. "property of a from" should be
"property of a form"
- Page 252, Paragraph 3, line 3. "Parent from" should be "Parent form"
- Page 285, Exercise intro, line 3. "we'll" should be "We'll"
- Pages 286 and 288. The Page 178 errata concerning App.Path also applies here.
- Page 290, second code window. lstStates.Txt is repeated twice---
remove the first one
- Page 309, Paragraph 3, line 1. "I keyed following line" should be
"I keyed the following line"
- Page 310. The average displayed in the screen shot should be 85, not 89.
- Page 320, Paragraph 4, Line 1. "it's" should be "its"
- Page 352, Paragraph 5, Line 3. "need to access to inventory" should be
"need to access the inventory"
- Page 368, code window.
If chkobject.Name = "Platter" Then
m_dshPlatter.Brand = lstBrands.Text
If chkobject.Caption = "Platter" Then
m_dshPlatter.Brand = lstBrands.Text
- Page 373, the Error handler should be
MsgBox Err.Number & ": " & Err.Description
- Page 400, Paragraph 7, Line 2. "we'll be modifying it to use the a collection"
"we'll be modifying it to use the collection"
- Page 448, 5th paragraph.
"just like the one's we've used" should read
"just like the ones we've used".
- Page 484, under Discussion. There's a mention of
using the Count property in the Click event procedure of cmdClassAverage.
Actually, at this point we're dealing with the China Shop project---and we'll
use the Count property of the Colleciton object in the TotalPrice Method we
code on page 486.
- Page 498, Exercise, Step 2. This code, as written, has a very subtle bug. If, after
placing a legitimate order, if you click on the Reset button, then select an item BEFORE
selecting a brand, then click on a brand, the program will attempt to remove a
non-existing item from the collection. Add this line of code right before the
m_strOldBrand = ""
- Page 545, Paragraph 4, line 1. Year should be 2000-not 1999.
- Page 545, Last Paragraph, Last sentence. "Its'" should be
- Page 549. A reader with Word 2000 reports that the line of code reading
.Selection.TypeText Text:="Class Average" & vbTab & vbTab & _
vbTab & vbTab & m_objCourse.ClassAverage
would not work until she changed it to
.Selection.TypeText Text:="Class Average" & vbTab & vbTab & _
vbTab & vbTab & "Str(m_objCourse.ClassAverage)"
- Page 549,Attention Box, line 2. "doe" should be "Doe"
- Page 567. There's a VB bug which causes the code in cmdPrint to bomb the second time the
print button is clicked. Add this code to the end of the procedure.
Set Word.Global = Nothing
- Page 566, Comment section. "Collecton" should be
- Page 570, Paragraph 4, Last line. "thing like that" should be
"things like that"
- Page 593, Paragraph 2, Last Line. "it's" should be "its"
- Page 594, Paragraph 4, Last Line. "and this important" should be
"and this is important"
- Page 596, Paragraph 3, First Line. "you haven't be able to make"
should be "you haven't been able to make"
None that we know of
The CD as supplied with the book has some differences in the code supplied.
In the start code, there is no "Readme.txt", the folder layout and CD name
are different. The CD volume label is "WROX_OBJECTS" and the code for
Chapter 01 is in the sub-folder "China Shop Code".
If you are reading this book after the Database book,
the project from the first book has been updated.
For that reason, use the code off the CD to 'revert' to pre-database status.
For those of you who have done the database course, it would be a good
idea to save/move that project to another folder and use the files off the CD.
The Number of visitors to this page since January 15, 2000
© 2000, Smiley and Associates, Inc.
Revised - April 8, 2001
| My book!