求一段asp的SQL查询写法。。谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/27 15:33:20
求一段asp的SQL查询写法。。谢谢
本人小白。大概表达一下以下的意思。。

用户页面输入用户名=A库user表的id 密码=A库user表的pass
正确后转到B库的class表ip列,查询user表的id,提取出B库class表的UID。
再去C库UID表查询之前提取出B库的UID,然后将其符合结果的SEX设定为0。

不知道有没有高手能写一个示范。。因为我太白了。。万分感谢。所有分数送出

你问题表达的太模糊了.不太明白你的意思.不过按照你的意思分2步来写
验证正确的用户名密码
sql="select pass from [user] where id="&request("用户名")&""
if rs.eof
response.write "<script>alert('不存在这个用户名');</script>"
end if
if rs("pass")<>request("pass")
response.write "<script>alert('密码错误');</script>"
end if
response.write "<script>alert('登陆成功');</script>"
session("user")=用户名
session("id")=id
把用户名跟ID保存在缓存里
然后
sql="select class where ip='"&session("id")&"'"
if rs.eof
response.write "<script>alert('记录不存在');</script>"
end if
session("uid")=rs("uid")
最后
sql="select UID where UID='"&session("uid")&"'"
if rs.eof
response.write "<script