VB interface to log in a password field input into how the time is not password *

Dim myCon As New ADODB.Connection 'database connection
Dim myRs As New ADODB.Recordset' operating data
Dim strCnn As String

Private Sub Command1_Click ()
Dim sqldl As String
strCnn = “DRIVER = (SQL SERVER); SERVER = STAR; DATABASE = student course information database”
myCon.Open strCnn 'open the database
If Trim (Text1.Text = “”) Then
MsgBox “did not enter a user name, enter!”, VbOKOnly + vbExclamation, “prompt”
Text1.SetFocus
Text2.Text = “”
myCon.Close
Exit Sub
End If
'myRs.CursorType = adOpenKeyset
' myRs.LockType = adLockOptimistic
sqldl = “select * from password where username = '” & Text1.Text & “'”
myRs.Open sqldl, myCon

If myRs.EOF = True Then
MsgBox “Users do not have this, please re-enter the user name!”, vbOKOnly + vbExclamation, “prompt”
Text1.SetFocus
Text1.Text = “”
Text2.Text = “”
myRs.Close
myCon.Close
Exit Sub
End If

If myRs.Fields ( “password”) Trim (Text2.Text) Then
MsgBox “incorrect password, please re-enter!”, vbOKOnly + vbExclamation, “prompt”
Text2.SetFocus
myRs.Close
myCon.Close
Exit Sub
End If

End Sub

the input box has a password attributes.This attribute set to enter a password like * passwordChar the attributes you do not * set the bar.

Leave a Reply