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?....

Recommended Answers

All 5 Replies

Use the code this way :

If usertxt.Text = Data1.Recordset.Fields("Username") And passtxt.Text =       Data1.Recordset.Fields("Password") Then
    MsgBox "Login successful"
    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...

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.

I already did that before you mentioned ur last message....:-)

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.....

Be a part of the DaniWeb community

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