| |||
| Conexión a BD access
Código:
Option Explicit
Public cnn1 As ADODB.Connection
Public Sub main()
'Dim form1 As frmverdatos
Dim cnn1 As ADODB.Connection
Set cnn1 = New ADODB.Connection
cnn1.ConnectionString = "provider=microsoft.jet.OLEDB.4.0;" & "data source=" & App.Path & "\VIDEOCLUB.mdb"
cnn1.Open
If cnn1.State = 1 Then
MsgBox ("conexion establecida")
Else
MsgBox ("error en la conexion")
End If
'Set form1 = New frmverdatos
Load Form1
Form1.Show
'cn.Close
'Set cn = Nothing
End Sub
|