Go To Homepage



Book Details
Visual Basic 2008 Recipes: A Problem-Solution Approach book cover
  • By Todd Herman Allen Jones Matthew MacDonald Rakesh Rajan
  • ISBN13: 978-1-59059-970-9
  • ISBN10: 1-59059-970-5
  • 704 pp.
  • Published Apr 2008
  • Print Book Price: $52.99
  • eBook Price: $37.09



Errata Submission

If you think that you've found an error in Visual Basic 2008 Recipes: A Problem-Solution Approach, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.

Submit Errata
Visual Basic 2008 Recipes: A Problem-Solution Approach (978-1-59059-970-9)

Errata

Issue Author's Response
Source code file is corrupt you can only download 7MB of 15MB I am sorry that you are having a problem downloading the files. I have no control over the Apress site (that has the source files) but I let them know that you had experienced issues. As a test, I just tried to download the files and had no problems. Perhaps you can try again.
Ch.5 P.190
If file.Attributes And FileAttributes.ReadOnly = FileAttributes.ReadOnly Then

Should be

If file.Attributes And FileAttributes.ReadOnly Then

Thanks,
Tarek
No. The statement in the book is accurate. Making the change you suggest won't cause an error (neccessarily) because a 1 is returned which resolves to a true.

The "And" is doing a bitwise comparison to determine if the ReadOnly bit is "on" in the Attributes flag. You need the "= FileAttribues.Readonly" there for the comparison.
I tried to download the pdf Table of contents on http://www.apress.com/book/downloadfile/3984 but the pdf creates an error and cannot be opened also tried Chap 01 I went to the link you provided and was able to download the table of contents and first chapter and view them both with no issues. The only thing I can think of is that something may be wrong with the PDF viewer you are using (such as Adobe Reader) or it is an older version.
Page 207

comment has:
' Parse all the fields into the currentRow

Believe this should be:
' Parse all the fields into the currentRecord

Thanks!
Michael
You are correct. Another typo.
When I attempt to run Recipe05-08 I get an exception thrown when it gets to the line:

fs.Position = 0

The exception is "Cannot access a closed file."

It appears as if the StreamReader above once done is somehow closing the file.
You are correct. I just ran the code and it gave me that error as well. I apologize for that.

It seeams that when the StreamReader is closed and disposed (which occurrs when its "End Using" statement is reached) causes the underlying FileStream to close as well.

There are a couple different ways this can be fixed. You could rewrite the code to not use USING statements and to explicitly close the StreamReader when it is no longer needed. I went for the quick fix which was to move the END USING for the Stream Reader to after the Binary Reader code. LIke this:

Using sr As New StreamReader(fs)
Console.WriteLine(sr.ReadToEnd)
Console.WriteLine()

' Reposition the FileStream so we can reuse it.
fs.Position = 0

' Read the data and convert it to the appropraite data type.
Using br As New BinaryReader(fs)
Console.WriteLine(br.ReadDecimal)
Console.WriteLine(br.ReadString)
Console.WriteLine(br.ReadString)
Console.WriteLine(br.ReadChar)
Console.WriteLine(br.ReadChar)
End Using
End Using
Recipe05_01 code.

Main is defined incorrectly:

has:
Public Shared Sub Main(ByVal args As String)

I believe it should have:
Public Shared Sub Main(ByVal args As String())

Thanks!
Michael
Thanks again. You are correct. It is the correct way in the downloadable source code so yet another typo in the text.
Page 187 line 17

Has:
Console.WriteLine(file.Attributes.ToString)

I believe this should have:
Console.WriteLine(dir.Attributes.ToString)
Yes you are correct and this is actually a case where the source code was wrong as well.

Thank you.
Page 91 (23 lines from the bottom)ish

has:
' Rebuild the lists of people form the binary and SOAP

Believe it should have:
' Rebuild the lists of people from the binary and SOAP

Thanks!
Michael
Yes, you are correct. Yet another typo.
Page 76 (6 lines from the bottom)

Has:
Console.WriteLine(" {0}", pstDTO).ToString()

Should Have:
Console.WriteLine(" {0}". pstDTO.ToString())



also (17 lines from the bottom the comment)



Has:
' converted to the Pacific Stanard Time time zone.

Shoule Have:
' converted to the Pacific Standard Time time zone.



I would also like to just say I am REALLY enjoying this book and learning a lot from it! Thank you for writing it!

Michael

FYI - I tried to run the code as listed for Recipe02_09 like I have the others. Create a VB file and then compile using the vbc. But for some reason I would get an error from the compiler for the TimeZoneInfo (is not declared). I COULD however, run this as a console project in the VS2008. Strange!?!
Correct again. Just a typo in pasting the code into the text. Again, the source code is downloadable and a great reference if you need to double check any more of these. I tested all the code.

Thanks again for saying you enjoy the book. I have a new blog up at blogs.TheCodeArchitects.com and you can contact me directly through that if you have further questions (but continue to submit erratta as well).

Regarding your compiler issue, I am not sure what is happening. I just dropped to DOS and ran the compiler on the project and it compiled fine. The only possible thing I can think of is that, since TimeZoneInfo is new to .NET 3.5, make sure you are using the correct version of the VBC.
Page 322:

Down in the source code under the comment:

' Process the second set of results and display...

There is a line that reads:

reader.NextResult()

Then it appears that it should show the Employee Table MetaData, however nothing is displayed in the console. I see that there is also a typo in the second query in the com.CommandText it has:

SELECT * FROM humanResources.Employee

This should read:

SELECT * FROM HumanResources.Employee

but that still does not display anything for the Table Metadata.

I added the following line above the "For field As Integer..... line"

Console.WriteLine("FieldCount: " & reader.FieldCount.ToString) and this displayed to my console:

"FieldCount: 0"

Thanks!
Michael
Regarding the typo, I did use "HumanResources" once and "humanResources" the second time. While that is not a good way to do it I wanted to be sure that you understand that SQL statements like this are not case sensitive and the query should be unaffected. However, you are correct in pointing it out as it is not a good practica and can cause confusion. Also, I did have it typed correctly in the downloadable source code :)

I looked at the text and the code itself and even reran it on my system and the sample runs fine. I am not sure why you are not receiving any data. If you are getting data from the first section, then your Employee table should be fine. Take a very close look at the second query just to make sure there aren't any other typos.
Page 322:

There is a line that has:
Using com As SqlDbCommand = con.CreateCommand

This gives an error when compiled, should this line read?

Using com As SqlCommand = con.CreateCommand

Thanks!
Michael
You are correct. It should be as you suggested. Thank you for letting me know.

I notice that you have several errata submitted so I will only say the next stuff this one time. I appreciate you enjoying the book and submitting the errata. I apologize that a few things were missed. If you haven't downloaded the source code from the Apress site, I suggest doing that as well. Since that was all compiled and tested and may be more accurate than the text. In this instance, the downloadable source code had the correct value.
Under Book Extras, book's Source Code is missing ...
I've bought the book for quick recipes intimintation please help me how to find this book's source code.
Thank you in advance.
I am guessing that the note I received (that the source code isn't shown under "Book Extras" is old. That was a problem back when the book was initially released but it has been fixed for a while. The direct link is: http://www.apress.com/book/downloadfile/4023.