0

I get this error message when trying to open my 2002 access database using MS visial Studio 2005
"System.IO.FileNotFoundException was unhandled" using the code below

Imports System.Data.OleDb
Imports System.Console
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader

Source=C:\temp\MIRC\CCC_DATA.mdb;Persist Security Info=False")
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\temp\MIRC\CCC_DATA.mdb;")
cn.Open()

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by kyoussouf
0

this following code to display data on datagrid.

Dim con As New OleDb.OleDbConnection
    Dim cmdOle As New OleDb.OleDbCommand
    Dim dsOle As New DataSet
    Dim da As New OleDb.OleDbDataAdapter
    Dim dtOle As New DataTable
    Dim sql As String

Private Sub LoadData()
        con.ConnectionString = ("Provider = Microsoft.JET.OLEDB.4.0;Data Source= D:\Only Me\Authors.mdb")
        Try
            cmdOle = con.CreateCommand
            cmdOle.CommandText = "SELECT * FROM Authors "
            da.SelectCommand = cmdOle
            da.Fill(dsOle, "Authors")
            dgAuthor.DataSource = dsOle
            dgAuthor.DataMember = "Authors"
            dgAuthor.ReadOnly = True
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub

    Private Sub Search_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadData
    End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.