We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,985 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

System.Data.Oledb.OledbException

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()
2
Contributors
1
Reply
5 Hours
Discussion Span
3 Months Ago
Last Updated
3
Views
devianleong
Light Poster
44 posts since Dec 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

What error is being thrown?

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

Begginnerdev
Practically a Posting Shark
862 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0616 seconds using 2.73MB