asp连接数据库问题
<%response.cachecontrol="no-cache"
response.addHeader "pragma","no-cache"
response.expires=-1
response.expiresAbsolute=now-1
dim ss
ss=unescape(Request.Querystring("name"))
set conn1=Server.CreateObject("ADODB.Connection")
conn1.Open "Provider=SQLoledb;data source=YAO;UID=;PWD=;Initial Catalog=rainbow;Integrated Security=SSPI"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM ["&Session("name1")&"] WHERE code='"&ss&"'",conn1,1,3
if not rs.EOF then
Response.Write escape("已经在好友列表上!"))
else
Set rs2= Server.CreateObject("ADODB.Recordset")
rs2.open "SELECT * FROM Userinfo WHERE code='"&ss&"' and code<>'"&Session("name1")&"'",conn1,1,3
if rs2.Eof then
Response.Write escape("不能加自己!"))
else
if rs2("request")<>"" then
rs2("request")=session("name1")+"|"+rs2("request")
else
rs2("request")=session("name1")
end if
rs2("send")=0
rs2.update
if rs2("request")<>"" then
response.Write escape("发送成功!"))
else
response.Write escape("发送失败!"))
end if
end if
end if
%> 错误号:500老提示服务器错误,找不到原因,请求帮助