sql如果有返回值,返回几个列,Values.Count就有几个。
cmd.CommandText = "Se lect 用户组,姓名 from {用户表} W here 用户名 = '" & UserName & "' And 密码 = '" & EncryptText(Password,"123","321") & "' and 启用 = True"
Dim Values = cmd.ExecuteValuesif Values.Count > 0 then '先判断是否有返回值
If Values("用户组").ToString <> Nothing Then ‘再判断某个列是否有值
UserGroup = Values("用户组")
endif
If Values("姓名").ToString <> Nothing Then ‘再判断某个列是否有值
xm = Values("姓名")
endif
Verified = True
endif