sql="select password from usertable where userid='" & txtUser.text & "'"
dim dr as datareader
dr= dataadapter.executeReader()
if(dr.read())
if dr("password") is nothing
msgbox "此用户名不存在"
exit sub
else
if dr("password")<>txtPassword.text then
msgbox "密码错误"
exit sub
end if
end if