Imports System.Data.OleDb
Public Class Form1 Dim connectionString As String Dim cnn As OleDbConnection Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Database3.mdb;" cnn = New OleDbConnection(connectionString) Try cnn.Open() MsgBox("Connection open") cnn.Close() Catch ex As Exception MsgBox("connection is no open") End Try End Sub
No comments:
Post a Comment