Private Sub Command1_Click(Index As Integer)
If KeyAscii = vbEnter Then
If Len(Trim(txtlogin)) > 0 And Len(Trim(txtpwd)) > 0 Then
If CheckPwd(txtlogin, txtpwd) = "ok" Then
MsgBox "Password ok"
Else
MsgBox "Wrong password or Login not found."
End If
Else
MsgBox "Login and password should not be blank"
End If
End If
End Sub
Private Function CheckPwd(cLogin As String, cPwd As String)
'in my case i will use dao. you probably using ado just convert it
Dim rs As Recordset, ret As String
Set rs = opendatabase("D:\student\vb\Database1.mdb").openRecordset("select * from Table1 where ucase(trim(logname)) = '" & UCase(Trim(cLogin)) & "'")
If rs.RecordCount <> 0 Then
If UCase(Trim(rs(pword))) = UCase(Trim(cPwd)) Then
ret = "ok"
Else
ret = "wrong"
End If
Else
ret = "wrong"
End If
rs.Close: CheckPwd = ret
End Function
This is my code for login page.....i had attached wat error i m gettin ........so i need solution .....can any one help me plz!!!!!!!!!! i m using access database....