Conectar Access 2013 - 2016 Con VB Net

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

CONECTAR ACCESS 2013 A, 2016 CON VB NET

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


abrirConexion()
End Sub

PROGRAMAR EN EL MODULO
Imports System.Data.OleDb
Module Conexion

Public cn As OleDbConnection
Public cadenaConexion As String

Sub abrirConexion()
Try
cn = New OleDbConnection
cadenaConexion = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
My.Computer.FileSystem.CurrentDirectory + "\Tutorial.accdb"
cn.ConnectionString = cadenaConexion
cn.Open()
MsgBox("CONECTADO")
Catch ex As Exception
MsgBox("NO CONECTADO")
End Try
End Sub
End Module

You might also like