0

As title show. I still not able to connect my ms.access login database . Please help me ~

        Dim con As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\leong\Documents\Visual Studio 2010\Projects\WindowsApplication4\WindowsApplication4\coursework.accdb")
        ' Dim cmd As OleDbCommand = New OleDb.OleDbCommand("SELECT * FROM AdminUser WHERE Username ='" & Usernametxt.Text & "' AND Password ='" & Passwordtxt.Text & "'", con)
        Dim cmd As New OleDb.OleDbCommand("SELECT * FROM AdminUser WHERE Username = 'admin' AND Password = 'admin'", con)
            con.Open()


        Dim sdr As OleDb.OleDbDataReader

        sdr = cmd.ExecuteReader()
        ' If the record can be queried, Pass verification and open another form.  
        If (sdr.Read() = True) Then
            MessageBox.Show("The user is valid!")

        Else
            MessageBox.Show("The user is invalid!")
        End If


        sdr.Close()
        con.Close()

Edited by devianleong

2
Contributors
1
Reply
4
Views
4 Years
Discussion Span
Last Post by Begginnerdev
0

What error is being thrown?

We can't begin to debug if we don't know the region to start.

Edited by Begginnerdev

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.