I am creating an MDI application that asks the user for a User ID and Password to be able to show personal details once verified. Details of user ids and passwords are available in a MS Access Table1. There is another table2 for user details, and another one yet for transactions made by the user table3.

I have created the connection from access to vb.net through OLEDB.

The only outcome I have managed to produce is a datgrid showing all users, all passwords, and all transactions for each and every user. I.e. >> OleDbDataAdapter1.Fill(dsTable()) :(

I need a procedure that asks the user for his ID and password, then once these are verified, only his appropriate details are shown. Example:

If txtUserID and txtPassword = True then
Show in label 1 Name
SHow in label 2 Surname
etc etc

Can somebody help with code ?

Re: VB.NET Login Verification 80 80


If txtUserID and txtPassword = True then

while you configure your data adapter , the sql statment will be something like this

Select Name,  Surname from Tablel_name WHERE ([B]id=?[/B])

the question mark means that you will select specific row based on id (primary key)
then in your code you will verify that user entered correct information . after that replace the question mark with value you got from the user

OleDbDataAdapter.SelectCommand.Parameters("[B]ID[/B]").Value = TextBox1.Text

Show in label 1 Name
SHow in label 2 Surname
etc etc

Label1.Text = DataSet.Table_name.Rows(0).Item("Name") 
etc etc ..

hope that help you :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.