Koneksi VB .Net Dengan Database Microsoft Accses
Simpan Database Accses anda ke Folder Bin/Debug/NAMADATABASE dalam Poject VB .Net
Imports System.Data.OleDb
Module Module_koneksi
Dim connection As New OleDbConnection("provider=Microsoft.jet.oledb.4.0;data source=" & Application.StartupPath & "\NAMADATABASE.mdb")
Private Sub connection_open()
Try
If connection.State <> ConnectionState.Closed Then connection.Close()
connection.Open()
Catch ex As Exception
End Try
End Sub
Private Sub connection_close()
Try
If connection.State <> ConnectionState.Open Then connection.Open()
connection.Close()
Catch ex As Exception
End Try
End Sub
End Module
Comments
Post a Comment