关于ASP中的字符比较

来源:百度知道 编辑:UC知道 时间:2024/05/21 06:55:52
在ASP中获取到密码域了的密码为"123"(我不知道是什么字符类型)在SQL中的密码字段中的值"123"(123字段类型是Char).我想用123=123这样了通过密码确认进行登入。

他们两个不是同一种字符类型,要把他们共同转为什么类型进行转换呢??

请问这个怎么解决呢,高手帮帮忙啊!
dim a,b
a=(upwd)
b=trim(rs("upwd"))
if a<>b then
response.Write "<p align=center><font color='#FF0000'>密码不正确</font><p>"
else
response.Redirect"index.asp"
end if

123是数字
一般只能在2个变量间比较
你可以这样
a=123
b=123
if cstr(a)=cstr(b) then
response.write "相同"
else
response.write "不相同"
end if

转换成函数就好
cstr(123)=123(123字段类型是Char).