I have a LogIN form - usertxt and passtxt and a button, and what I want to know is how to call the values of the fields user and password in the database access to open the MAIN FORM..I am connected using DATA1.RECORDSET..Is it possible instead of using ADODC?....

Use the code this way :

If usertxt.Text = Data1.Recordset.Fields("Username") And passtxt.Text =       Data1.Recordset.Fields("Password") Then
    MsgBox "Login successful"
Else
    MsgBox "Wrong username or password!"
    End If

:-) i think I need to change my 2 textboxes to this name you gave....Thanks sir, ill try this code of yours...

Edited 2 Years Ago by NewCoder_31

Don't code your controls name. Change the code snippet given. If you are able to program something than this is not good for you to neither for me to spoon feed you.Try every thing on your own.

You may write the Filtering Codes to check in the Password Table in your Database, the Username and Password together that were Typed in the Text Boxes on the VB Form. If both found by the Filtering codes. then below (If Adodc1.EOF = False then) to make appear the Form2 or MdiForm1 or whatever it is to .Show
I hope you got some idea from the above information. Sorry, I am unable to write the coding for you for Filtering with the Connection string. I too was using the Adodc controls before and now I have stopped it. Adodc control is good for a Single user environment. If you want to go for a Multiuser environment project, you will have to use the connection string such as conn string coding with a Public Class Module and so on.....

This article has been dead for over six months. Start a new discussion instead.