Visual Basic - problemas conexión con access 2013

Life is soft - evento anual de software empresarial
   
Vista:

problemas conexión con access 2013

Publicado por Guillermo Fuentes guillermo.f1990@gmail.com (1 intervención) el 15/11/2015 06:49:57
estimados, he estado realizando algunos programas en visual últimamente (bastante simples) en los que me he conectado a bases de datos access 2013, el problema es que la versión que tenia antes era de 32 bits y ahora que instalé la de 64 bits no me permite abrir las conexiones, alguien podría ayudarme con esto? dejo el código del login que generé

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Imports System.Data
Imports System.Data.OleDb
Public Class Login
    Dim conection As New OleDbConnection
    Dim command As New OleDbCommand
    Dim adapter As New OleDbDataAdapter
    Dim reader As OleDbDataReader
    Dim consult As String
    Dim r As String
    'sobre escribir
    Private Sub overwrite()
        user.Text = "USERNAME"
        pass.Text = "USERNAME"
    End Sub
    'cerrar
    Private Sub cerrar()
        conection.Close()
        End
    End Sub
    'conectar a base de datos
    Private Sub Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim path As String
        path = My.Application.Info.DirectoryPath
        Gro.Focus()
        r = 0
        Try
            conection.ConnectionString = conection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & path & "\DB.accdb"
            conection.Open()
        Catch ex As Exception
            MsgBox("")
            conection.Close()
            cerrar()
 
        End Try
    End Sub
    'limpliar caja de texto
    Private Sub user_GotFocus(sender As Object, e As EventArgs) Handles user.GotFocus
        user.Clear()
    End Sub
    'limpliar caja de texto
    Private Sub pass_GotFocus(sender As Object, e As EventArgs) Handles pass.GotFocus
        pass.Clear()
    End Sub
    'limpliar caja de texto
    Private Sub user_lostFocus(sender As Object, e As EventArgs) Handles user.LostFocus
        If user.Text = "" Then user.Text = "USERNAME"
    End Sub
    'limpliar caja de texto
    Private Sub pass_lostFocus(sender As Object, e As EventArgs) Handles pass.LostFocus
        If pass.Text = "" Then pass.Text = "USERNAME"
    End Sub
    'cerrar
    Private Sub not1_Click(sender As Object, e As EventArgs) Handles not1.Click
        conection.Close()
        End
    End Sub
    'ingresar
    Private Sub yes1_Click(sender As Object, e As EventArgs) Handles yes1.Click
        If r = 7 Then
            MsgBox("retirese! su cuenta será bloqueada y su computador estallará en 7 segundos")
            If MsgBoxResult.Yes Then
                cerrar()
            End If
        End If
        If pass.Text = "USERNAME" Or user.Text = "USERNAME" Or user.Text = "" Or pass.Text = "" Then
            r = r + 1
            MsgBox("ingrese datos de usuario correctos", 48, "Información incorrecta")
            overwrite()
        Else
            consult = "SELECT Username, Password FROM Login WHERE Username = '" & user.Text &
            "' AND Password = '" & pass.Text & "'"
            command = New OleDbCommand(consult, conection)
            adapter.SelectCommand = command
            reader = command.ExecuteReader
            If reader.HasRows = True Then
                Inicio.Show
                Me.Close()
                conection.Close()
            Else
                r = r + 1
                MsgBox("ingrese datos de usuario correctos", 48, "Información incorrecta")
                overwrite()
            End If
        End If
    End Sub
End Class
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder