Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/08/2011, 09:40
Avatar de rikakashi
rikakashi
 
Fecha de Ingreso: julio-2011
Mensajes: 226
Antigüedad: 12 años, 10 meses
Puntos: 33
Respuesta: conexion a access

Código vb:
Ver original
  1. Imports System.Data.OleDb
  2. Public Class Form1
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.         Dim connetionString As String
  5.         Dim cnn As OleDbConnection
  6.         connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourdatabasename.mdb;"
  7.         cnn = New OleDbConnection(connetionString)
  8.         Try
  9.             cnn.Open()
  10.             MsgBox("Connection Open ! ")
  11.             cnn.Close()
  12.         Catch ex As Exception
  13.             MsgBox("Can not open connection ! ")
  14.         End Try
  15.     End Sub
  16. End Class