How to connect username and password in a database for more secure login?

What is the problem?

You don't know how to Connect to the DB? or you don't know how to retrieve?

What is the problem you are having.

Normally I would not help with sample code if NOTHING has been given, but hey, what the heck.... Please give us MORE info next time, like what YOU have coded so far etc.

Look at the attached for a sample...

patishere,
you are lucky since AndreRet gave you sample code without seeing your effort. As said by AndreRet we don't give full source code before seeing your hard work. I hope AndreRet's help will be helpful.

thankx

commented: Keep it up +1

How to connect username and password in a database for more secure login?

yeah.. your lucky.. hehe.. maybe you can use encryption method in your application for it if you want it secured.

Oops sorry for that. I know how to code simple login but I want more secure like connecting it with a database to check if username and password exist.

Okay here is my simple login code.

Private Sub Command1_Click()
Dim login As Integer
Text2.SetFocus

If Text1.Text = Text1.Tag And Text2.Text = Text2.Tag Then
intResponse = MsgBox("Username and Password Matched", vbInformation, "iWeb Browser", 3, 1)
passfrm.Hide
rules1frm.Show
passfrm.Hide

ElseIf (Text1.Text = "") And (Text2.Text = "") Then
intResponse = MsgBox("What are you trying to do?", vbCritical + vbOKOnly, "Warning!")
intResponse = MsgBox("Please Enter Correct Password!", vbCritical + vbOKOnly, "iWeb Browser")
Text1.Text = ""
Text1.SetFocus
Else
intResponse = MsgBox("Password is incorrect!", vbCritical + vbRetryCancel, "iWeb Browser")
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text1.BackColor = vbYellow
Text2.BackColor = vbYellow
End If
End Sub

I think AndreRet has a source code for you.
See my attached help but sorry for no comments in my source code. If you have any problem then you are welcome to ask me.
thanks

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.