Click here to Skip to main content
15,917,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hope all is fine,ihave created four tables,each with a form and aquerry. Now ihave created also a user table with password and username created also alogin form. Iwant to open the database such that alogin form appears first so that the user inputs his/her password to access the database. please help me with this problem,ihave failed somewhere.
regards
Asaku Richards
Posted
Comments
[no name] 20-Jul-13 7:56am    
Yes you failed to describe a problem, ask a question, show us the code that you have written...

1 solution

Hi,
Do you want a simple login form validating the valid user from Ms access db.

here is sample code with vb.net.

VB
            Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\testdb1.mdb;Jet OLEDB:Database Password=1234;")
            Dim cmd As OleDbCommand = New OleDbCommand("Select * from testtable where username= '" & TextBox1.Text & "' ", cn)


            cn.Open()

            rdr = cmd.ExecuteReader
            If rdr.HasRows Then
''               do your code here
            Else
                MsgBox("Incorrect Username/Password")
                TextBox1.Clear()
                TextBox1.Clear()

            End If
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900