Hi-
I have been reading the book and completing the examples as I go. I just finished building the UI in Appendix B (keystroke by keystroke) and found it an invaluable intro to the
VB environment.
At the completion of Appendix B the interface launched nicely and clicked about as it should.
However, upon returning to the beginning of chapter 6 and entering the code on pages 131-132 I managed to hose it. When starting the project it pauses for 10 seconds and pops up the error "Could Not Find Installable ISAM". It then launches the UI but no projects are visible. (I assume it can't see the database.
I went back and confirmed that my path to the Timetracker Access Database was correct in my app.config, (I am using the sample code database in the chapter 1 directory) and it appears to be. Here is my app.config-
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Provider" value="Microsoft.Jet.OLEDB.4.0" />
<add key="Data Source" value="C:\Documents and Settings\Christopher.FLEMINGWHITE\My Documents\VBNet Code Samples\All_Code\Chapter 01\ProjectTimeTracker.mdb" />
<add key="Initial Catalog" value="Nothing" />
<add key="User ID" value="Nothing" />
<add key="Password" value="Nothing" />
</appSettings>
</configuration>
As a side note, both "Access-Queries" from chapter 5 worked (and still work) using the same database.
If I comment out the Call to LoadProjects the UI comes right up.
Also, I implemented the erratta for Appendix B(Page682)
Thanks for any help you may have-
Chris
Here is all the code I typed between it working and it not working:
Private Sub LoadProjects()
'Declare variables
Dim objListViewItem As ListViewItem
'Initialize a new instance of the data access base class
objdata = New DALBase
Try
'Get all projects in a datareader object
objdata.SQL = "usp_SelectProjects"
objdata.InitializeCommand()
objdata.OpenConnection()
objdata.DataReader = objdata.Command.ExecuteReader
'see if any data exists before continuing
If objdata.DataReader.HasRows Then
'Clear previous list
lvwProjects.Items.Clear()
'Process all rows
While objdata.DataReader.Read()
'Create new listviewitem
objListViewItem = New ListViewItem
'Add the data to the list view item
objListViewItem.Text = objdata.DataReader.Item("ProjectName")
objListViewItem.Tag = objdata.DataReader.Item("ProjectID")
'Add the sub items to the list view item
objListViewItem.SubItems.Add( _
objdata.DataReader.Item("ProjectDescription"))
objListViewItem.SubItems.Add( _
objdata.DataReader.Item("SequenceNumber"))
objListViewItem.SubItems.Add( _
Format(objdata.DataReader.Item("LastUpdateDate"), "g"))
'Add the listview item to the listview control
lvwProjects.Items.Add(objListViewItem)
End While
End If
objdata.DataReader.Close()
Catch ExceptionErr As Exception
MessageBox.Show(ExceptionErr.Message, strAppTitle)
Finally
'Cleanup
objdata.Dispose()
objdata = Nothing
objListViewItem = Nothing
End Try
End Sub
'AND the loadprojects procedure on page 132
Call LoadProjects()