Public UserName as string
sub Main
call login
...
end sub
Form Login--
Button Login_Click:
...
if VerifyPwd = True then --如果验证口令通过
UserName = txtUser.text
end if
...
Form ResetPWD---
Button Reset_Click:
...
sqlStr = "Select * from Oper where User = '"+UserName+"' and Pwd = '"+txtOldPwd.text+"'"
...