Errata

Microsoft® Visual Basic® 2008 Step by Step

Errata for Microsoft® Visual Basic® 2008 Step by Step

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
PDF
Page 393
Sterp 10 of Inherit a sinple dialog box

Why does this section ignore the fact that Visual Basic 2008 Express edition does not contain the Inherits Form template & Inheritance Picker options? As a result I had to search Visual Studio help to find out how to manually add the correct inheritance to Form2 before I could complete the exercise.

I'm an experienced developer so I could work out what to do, but not everyone reading this book will be. Adding a side bar with instructions for Express Edition users to follow in this instance would have been helpful. Perhaps in books for future versions of VB?

Note from the Author or Editor:
You are correct that Chapter 16 in MS Visual Basic 2008 Step by Step does not include a work-around about inheriting forms for readers that do not own a retail version of Visual Studio 2008. The reason for this is that the Visual Basic 2008 Express trial download was not available when the full 2008 product was released; when I wrote this book I did not know precisely what limitations the free Express product would have. However, when the Visual Studio 2010 product came out that information was available, and if you own the MS Visual Basic 2010 Step by Step book you will see that the instructions for inheriting forms in the Express product are detailed on p. 395 of that book. In general, the free Express download is an amazing value, but there are a few places where it does pay to have the full retail product.

Michele T  Oct 24, 2011 
Other Digital Version
437
Chapter 18 file

There seems to be a compatability problem with the Students.mdb in chapter 18 files that come with the companion CD I don't know if this is compatible with Windows 7 or if it is .net framework 4 that is the trouble. My earlier comment that there is no data in the data base is not the case it is just that none of the programs, either mine or the authors, can access the data when run.

Note from the Author or Editor:
You are correct--there will probably be forward compatibility issues with the Students.mdb database used in Chapters 18 and 19 of the VB 2008 Step by Step book. That book was published in 2008 and the Access database format we used was Access 2002/2003, so that we would be compatible with Access 2007, Access 2002/2003, and even Access 2000. Note that Access itself is not needed to use the Students.mdb database, because Visual Studio has the necessary support to work with the files without you having the Office software.

Databases do have forward compatibility issues, and issues like 64-bit software and later versions of the Windows operating system can also cause complications. The solution that I recommend, of course, it to upgrade to the Visual Basic 2010 Step by Step book, which supports Access 2010 and Access 2007 formats. This is because the ADO.NET data access technology is best learned with more contemporary formats--if you have access to them.

Len Williams  Feb 10, 2011 
Other Digital Version
CD
Chapter 18

The database in the learning files on the accompanying CD in the chapter 18 folder,Students.mdb has no data in it so chapters 18 and 19 cannot be satisfactorily completed.

Note from the Author or Editor:
The database does have data in it; what you are seeing is probably the result of using Windows 7 or a 64-bit operating system to access an Access database compatible with Access 2002/2003 and 2007. When this book was published in 2008 the Access database exercises were designed to match current operating system and database conditions. If you are still using the VB 2008 software but have newer operating system components, you may see the results that you have reported, but not under all conditions. The VB 2010 Step by Step book may be a better solution as it supports Access 2010, Windows 7, and the most recent database technology.

LenWilliams  Feb 08, 2011 
Printed, PDF
Page 299 and 300
See description

On page 299, the last paragraph of step 7 begins "This event procedure clears the text box object when the user clicks the Sort Array button..." Ostensibly, the clearing action is performed by the line "TextBox1.Text = """, but it doesn't do that in practice, because before the sub procedure returns to the application, Textbox1 will be further updated by the line "TextBox1.Text = TextBox1.Text & RandArray(i) & VbCrLf". To make the text box clear whilst the sorting process is being carried out, this new line of code "TextBox1.Update()" must be inserted between "TextBox1.Text = """ and "Array.Sort(RandArray)".

The full code listing should be:

'Sort the array using the Array.Sort method and display
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim i As Integer
TextBox1.Text = ""
TextBox1.Update()
Array.Sort(RandArray)
For i = 0 To UBound(RandArray)
TextBox1.Text = TextBox1.Text & RandArray(i) & vbCrLf
ProgressBar1.Value = i 'move progress bar
Next i
End Sub

On page 300 there is a similar problem with the code in step 8. The code should be:

'Reverse the order of array elements using Array.Reverse
Private Sub Button3_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button3.Click
Dim i As Integer
TextBox1.Text = ""
TextBox1.Update()
Array.Reverse(RandArray)
For i = 0 To UBound(RandArray)
TextBox1.Text = TextBox1.Text & RandArray(i) & vbCrLf
ProgressBar1.Value = i 'move progress bar
Next i
End Sub

Note from the Author or Editor:
It is not necessary to clear the text box on the screen during this operation, but if you would like to do so, the Update() method provides a great way of updating the text box visually after its contents have been deleted. Update() takes a tiny bit of time, though--be careful about using it too much--

The instruction on p. 299 is not technically an error because the book does not say that the text box shown on screen will be cleared. It only indicates that the text box object (the entity held in memory) will be cleared (or reset) so that the array contents can be sorted.

As the reader notes, Update() is a great tool for forcing an update.

Michael Hitchin  Aug 07, 2010 
Printed
Page 84

File extension missing in code example
On page 84, the third line of the code example in Step 8 is missing a file extension.



Change:

("c:vb08sbschap03calcultr")To:

("c:vb08sbschap03calcultr.bmp")

Note from the Author or Editor:

Error corrected. Will be fixed in next printing.

Microsoft Press  Jul 13, 2010  Oct 21, 2011
Printed
Page 84, 88, 89
1st paragraph

The statement:

PictureBox1.Image = System.Drawing.Image.FromFile("c:\vb08sbs\chap03\calcultr") should be

PictureBox1.Image = System.Drawing.Image.FromFile("c:\vb08sbs\chap03\calcultr.bmp")

Note that ".bmp" must be added to the filename or this statement will not compile. In the next patch of code, this is also the case:

PictureBox2.Image = System.Drawing.Image.FromFile("C:\vb08sbs\chap03\copymach") should be

PictureBox2.Image = System.Drawing.Image.FromFile("C:\vb08sbs\chap03\copymach.bmp")

Note from the Author or Editor:
The reader is correct--on p. 84 the file extension .bmp is missing from the suggested program code in two places. The same issue appears in the program code on pp. 88-90 (.bmp is missing).

However, on the companion disc these errors are not there and the code runs as described in the book. (Somehow the .bmp extensions were removed in the part of Chapter 3 during our publishing process.) Sorry!

Lamar Waguespack  May 22, 2010  Oct 21, 2011
Printed
Page 72

"2 objects" should be "OK"
On page 72, in Step 10 the setting of the Button1 Text property is incorrect.

Change:
"2 objects"

To:
"OK"

Note from the Author or Editor:

Error corrected. Will be fixed in next printing.

Microsoft Press  May 06, 2010  Oct 21, 2011
Printed
Page 402

Lines to be entered are not shaded
On page 402, the instructions in Step 2 state that you must type in the code that is shaded. However, the code that is shaded has already been populated.

The code that is currently shaded needs to be changed to non-shaded:
Get
Set(ByVal value As String)The following lines need to be shaded in the code example:
Return Name1
Name1 = value
Microsoft Press is committed to providing informative and accurate
books. All comments and corrections listed above are ready for
inclusion in future printings of this book. If you have a later printing
of this book, it may already contain most or all of the above corrections.

Note from the Author or Editor:

Error corrected. Will be fixed in next printing.

Microsoft Press  May 06, 2010  Oct 21, 2011