Imports System.Data.OleDb
Public Class Form1
Private Sub btnConect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConect.Click
Dim dbProvider As String
Dim con As New OleDbConnection
dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source = C:/AddressBook.mdb"
con.ConnectionString = dbProvider
con.Open()
MsgBox("Database está aberta agora!", MsgBoxStyle.Information)
con.Close()
MsgBox("Database está fechada agora!", MsgBoxStyle.Information)
End Sub
End Class
0 comentários:
Postar um comentário