View Single Post
  #2 (permalink)  
Old July 8th, 2003, 05:12 AM
bveerendrakumar bveerendrakumar is offline
Authorized User
 
Join Date: Jul 2003
Location: Hyderabad, Andhra Pradesh, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do the following

Note:
1. Substitute ur values at #places(For ex: if ur field name in databse is usrPwd then replace rs("Fieldname#").value as rs("usrpwd").value

2. Assume that ur passwd field text box name is txtPasswd

Private Function FindUser() as Boolean
    dim Cn as new Adodb.connection
    dim Rs as recordset
    cn.open("Dsn=#;Uid=#;Pwd=#;")
    set rs=new recordset
    rs.open("Sqlstatement#",cn,adopenstatic,adlockopti mistic)
    if trim(txtPasswd.text)=rs("Fieldname#").value then
         FindUser=True
    else
         FindUser=False
    endif
if cn.state then 'checking the connection wether it is opened
   cn.close
end if
set cn=nothing
if rs.state then
   rs.close
end if
set rs=nothing
exit funtion
ErrHand:
   msgbox err.description
end function

'Call this function from ur valid events to check wether pwd is correct or not, if password exists it returns true else it returns false

Hope this solution help you

B.V.Kumar
Reply With Quote