If statement 为什么';t如果比较工作
这是一个登录代码,还可以验证此人是否只是“管理员”或“职员” 这就是它似乎失败的地方If statement 为什么';t如果比较工作,if-statement,comparison,conditional-statements,If Statement,Comparison,Conditional Statements,这是一个登录代码,还可以验证此人是否只是“管理员”或“职员” 这就是它似乎失败的地方 If String.Compare(account_type, verify_account_type) = 0 Then application_form.Show() Me.Visible = False Else MsgBox("you are not an
If String.Compare(account_type, verify_account_type) = 0 Then
application_form.Show()
Me.Visible = False
Else
MsgBox("you are not an administrator")
End If
登录正常,但无法进行比较。基本上我有一个帐户类型的数据库(“管理员”和“职员”)。假设读取account_类型并将值放入一个变量中,该变量将与另一个值为“Administrator”或“Staff”但不是的变量进行比较
非常感谢您的帮助。如果有人在密码框中键入
”或“=”
,该怎么办?管理员应该用位值(true或false)来标记,而不是比较文本值。
If String.Compare(account_type, verify_account_type) = 0 Then
application_form.Show()
Me.Visible = False
Else
MsgBox("you are not an administrator")
End If