Learn To Program Objects With Visual Basic 6

Muska and Lipman

1929-685-165

Errata and FAQ's
(Last Update: May 17, 2006)

Errata list

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.

General #1---Unexpected 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 location

            C:\VBFILES\CHINA

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

Professor Smiley, 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!   I just 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:


Unload frmMain
End
Exit Sub

Chapter 1

None that we know of


Chapter 2


Chapter 3


Chapter 4


Chapter 5

       m_sngFinalGrade = stuNew.Average

If Len(App.Path) = "3" Then

Page 355, the Error Handler. Add

End

after 

Unload frmMain

    MsgBox Err.Number & ": " & Err.Description

' Check to see if any of the Dish types are instantiated...my change to the code on pg 374

If Not m_dshPlate Is Nothing Then
    curPlatePrice = m_dshPlate.Price
Else
    curPlatePrice = 0
End If

If Not m_dshButterPlate Is Nothing Then
    curButterPlatePrice = m_dshButterPlate.Price
Else
    curButterPlatePrice = 0
End If

If Not m_dshSoupBowl Is Nothing Then
    curSoupBowlPrice = m_dshSoupBowl.Price
Else
    curSoupBowlPrice = 0
End If

If Not m_dshCup Is Nothing Then
    curCupPrice = m_dshCup.Price
Else
    curCupPrice = 0
End If

If Not m_dshSaucer Is Nothing Then
    curSaucerPrice = m_dshSaucer.Price
Else
    curSaucerPrice = 0
End If

If Not m_dshPlatter Is Nothing Then
    curPlatterPrice = m_dshPlatter.Price
Else
    curPlatterPrice = 0
End If


Chapter 6

        Unload frmShipping


Chapter 7


Chapter 8


Chapter 9

If Len(App.Path) = "3" Then


Chapter 10

        regsvr32 c:/vbfiles/practice/activexdll/academicssupport.dll /u

 

        should be

 

        regsvr32 "c:\vbfiles\practice\activexdll\academicssupport.dll" /u

 


The Number of visitors to this page since January 15, 2001


1998-2004, Smiley and Associates, Inc.
Revised - January 29, 2004

webmaster@johnsmiley.com

[ Home | Books | Links | My book! |