Imports System.Data.OleDb
After you can use the function bellow:
Public Sub Connect_database()
Try
With connection
If .State = ConnectionState.Open Then .Close()
.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Contacts.mdb"
.Open()
End With
Catch ex As Exception
MessageBox.Show("Not connected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Application.Exit()
End Try
End Sub
To be honest I have never seen a better tutorials. Very well structured and descriptive. Keep up the good work. I am myself an experienced programmer but yet look at your work.
ReplyDelete