Search code examples
vb.netms-access-2007

"Could not find installable ISAM" error in VB.NET


Im new to visual basic.. I would like to ask on how to fixed the problem "Could not find installable ISAM.". I used Visual Basic as programming language. I used MS access as the database. My program is to fetch data from access. This would be my code.

Imports System.Data.OleDb

Module Main
Dim mDataPath As String

Sub Main()
    GetPupils()
    Console.ReadLine()

End Sub
Private Function GetConnection() As OleDb.OleDbConnection
    'return a new connection to the database5

    Return New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
     & "Database Password=oNer00FooR3n0 " & "Data Source=" & "C:\Users\ERICO YAN\Desktop\MSaccessDB\MSaccessDB\oneroofccp.mdb")
End Function


Public Function GetPupils() As DataSet
    Dim conn As OleDb.OleDbConnection = GetConnection()
    Try
        Dim ds As New DataSet  'temporary storage
        Dim sql As String = "select * from SESSIONS" 'query
        Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(sql, conn) 'connection

        Try
            da.Fill(ds, "SESSIONS") 'fetch data from db
        Finally
            da.Dispose()    'in case something goes wrong
        End Try

        Dim startVal = 0 'first record
        Dim endVal = ds.Tables(0).Rows.Count 'total number records

        For var = startVal To endVal - 1 'display records
            Console.WriteLine(ds.Tables(0).Rows(var).Item(0).ToString() + " " + ds.Tables(0).Rows(var).Item(1).ToString() + " " + ds.Tables(0).Rows(var).Item(3).ToString() + " " + ds.Tables(0).Rows(var).Item(3).ToString())  'code for display id and name
        Next


        Return ds

    Finally
        conn.Close()
        conn.Dispose()
    End Try

End Function
End Module

I would like to know what is the cause of the error so that I can proceed to my program.. Thank you so much for the feedback..


Solution

  • Missing ; delimiter here:

    ...Password=oNer00FooR3n0 " & "Data Sourc...
    

    Needs to be

    ...Password=oNer00FooR3n0 " & ";Data Sourc...
    

    Also just Password instead of Database Password.