Programming Microsoft Visual Basic .NET for Microsoft Access Databases Comments And Corrections (819944)



The information in this article applies to:

  • MSPRESS Programming Microsoft Visual Basic .NET for Microsoft Access Databases, ISBN 0-7356-1819-4

SUMMARY

This article contains comments, corrections, and information about known errors relating to the Microsoft Press book Programming Microsoft Visual Basic .NET for Microsoft Access Databases, 0-7356-1819-4.

The following topics are covered:

  • Page 61: Decimal Size in Bytes Should Be 16
  • Page 140: File Type Should Be .bmp
  • Page 159: Missing Lines
  • Page 311: Code can generate exception in some cases

MORE INFORMATION

Page 61: Decimal Size in Bytes Should Be 16

On page 61, in Table 3-1, the Data Type "Decimal" should have a Size in Bytes of 16. It is incorrectly shown as 1.

Page 140: File Type Should Be .bmp

In the last line of code shown on page 140 has the incorrect file type given.

Change:
"Office10\Samples\EmpID" & str2 & ".eps"

To:
Office10\Samples\EmpID" & str2 & ".bmp"

Page 159: Missing Lines

On page 159, in the code sample, two lines are missing.

Add the following two lines of code immediately before the line that reads "Return OrderTotal:

rst1.Close
cnn1.Close

Page 311: Code can generate exception in some cases

On page 311, in some cases, clicking the Go To button on Form3 generates an exception. To correct this error, modify the code in the Button5_Click event handler as follows:

Change:
Private Sub Button5_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button5.Click
 
    'Set pointer for new row value.
    Dim int1 = CInt(TextBox1.Text) - 1
 
    'Go to designated row, and save row position or
    'restore old row position.
    If int1 >= 0 And int1 <= DsOrderDetails1. _
        Tables("Order Details").Rows.Count - 1 Then
        DataGrid1.CurrentRowIndex = int1
        intOldRow = DataGrid1.CurrentRowIndex
    Else
        DataGrid1.CurrentRowIndex = intOldRow
    End If
 
    'Compute text box display showing current row
    'relative to total number of rows.
    UpdatePositionIndicator(DataGrid1)
 
End Sub

To:
Private Sub Button5_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button5.Click
 
    'Set pointer for new row value.
    Dim nSpace As Integer
    Dim sRange As String
    Dim sValue As String
    Dim nValue As Integer
    Dim int1 As Integer = 0
    sRange = TextBox1.Text
    nSpace = sRange.IndexOf(" ")
    If nSpace > 0 Then
        sValue = sRange.Substring(0, nSpace)
        If IsNumeric(sValue) Then
            nValue = Integer.Parse(sValue)
            If nValue > 0 Then
               int1 = nValue - 1
            End If
        End If
    End If

    'Go to designated row, and save row position or
    'restore old row position.
    If int1 >= 0 And int1 <= DsOrderDetails1. _
        Tables("Order Details").Rows.Count - 1 Then
        DataGrid1.CurrentRowIndex = int1
        intOldRow = DataGrid1.CurrentRowIndex
    Else
        DataGrid1.CurrentRowIndex = intOldRow
    End If
 
    'Compute text box display showing current row
    'relative to total number of rows.
    UpdatePositionIndicator(DataGrid1)
 
End Sub



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.

Modification Type:MajorLast Reviewed:2/28/2006
Keywords:kbdocfix kbdocerr KB819944 kbAudEndUser