Imports System.Data
Imports System.Data.OleDb
Module Module1
    Public cnn As New OleDbConnection
    Dim str As String

    Public Sub ConnectDatabase()
        Dim str As String
        str = "Provider = Microsoft.ACE.OLEDB.12.0;Data Source= D:\โครงงาน\Project\Database1.accdb;"
        If cnn.State = ConnectionState.Open Then cnn.Close()
        cnn.ConnectionString = str
        cnn.Open()
    End Sub
End Module
