silverstormboy
Member
HI, I have an error when i try to connect to my access database.
My code is as follows:
but when i click the form, this error appeared:
An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
Can somebody help me with this error?
I have installed MDAC 2.7, but still it cant work.
Is Northwind.mdb sample database is part of vs.net?because i cant find it.
Thanks for your help.
My code is as follows:
Code:
Imports System
Imports System.Data
Imports System.Data.OleDb
Public Class ListForm
Inherits System.Windows.Forms.Form
Private Sub ListForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strConnection As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& "C:\Reminder.mdb"
Dim cn As OleDbConnection = New OleDbConnection(strConnection)
cn.Open()
cn.Close()
End Sub
End Class
but when i click the form, this error appeared:
An unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll
Can somebody help me with this error?
I have installed MDAC 2.7, but still it cant work.
Is Northwind.mdb sample database is part of vs.net?because i cant find it.
Thanks for your help.