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.

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.


Edited 6 Years Ago by kinwang2009: n/a

Keep it up

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

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

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 = ""
intResponse = MsgBox("Password is incorrect!", vbCritical + vbRetryCancel, "iWeb Browser")
Text1.Text = ""
Text2.Text = ""
Text1.BackColor = vbYellow
Text2.BackColor = vbYellow
End If
End Sub

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