VB 问题,密码验证.

来源:百度知道 编辑:UC知道 时间:2024/05/06 11:47:48
'TblAccount 列:User、Password
'CmdLogin 登陆键
'DataCombo 用户选择 Datefield:User
'Adodc1 连接数据,读取用户信息
'TxtInput 密码输入框
'TxtPassword Datafield:password Visible=False
-----------------------------------------
我的想法是,DateCombo change (), TxtPassword.Text 也会随着改变
通过 CmdLogin_click() 来判断 TxtInput和TxtPassword 是否相同,来实现用户验证。但是TxtPassword.Text 无法通过DateCombo控件来改变。
请帮帮我,或者有别的思路清推荐!谢谢

两个TEXT
改名为:
user_text
pass_text

在用户按下登陆按钮时:
if trim(user_text) ="" then
msgbox "请输入用户名"
exit sub
end if
if trim(pass_text) ="" then
msgbox "请输入密码"
exit sub
end if

在这里,如果要连接数据库,就在这连接
得到表中的相对的用户名的密码
例:USER表中的值是:ADMIN PASS

那判断就是:

if (trim(user_txt) = sql_temp) then
if (trim(pass_txt)=sql_temp2) then
form1.show
end if
msgbox "错误"
exit sub
end if
unload me