private sub cmdOK_click()
dim strPass as string
dim rs as adodb.recordset
strpass=txtpass.text
'如果数据库中密码加密,则需要将strPass加密后再跟数据库比较
'strPass=Encode(strpass)
set rs=cn.execute("select count(*) from your_tbl where cPass = '" & strPass & "' and otherCondition
if rs.fields(0).value=0 then
msgbox "密码正确"
endif
end sub