刘元降桑椹拼音版:懂ASP的帮忙看下

来源:百度文库 编辑:神马品牌网 时间:2024/05/03 20:29:55
偶初学ASP,可能写的比较乱,总体思路是处理dudan表内数据,从表game中获取信息,处理结果更新在表winuser

<%
dim rscup,sqlcup,ending,username,rswin,sqlwin,rswinuser,sqlwinuser,score1,hteam,vteam,text1,totalwin,gameid,rsdudan,sqldudan,totalduzu,total,result,game1,game2,win,lost,duzu,db1,connstr1,conn1
db1="cup.MDB"
Set conn1 = Server.CreateObject("ADODB.Connection")
connstr1="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db1&"")
conn1.Open connstr1

set rsdudan=server.createobject("adodb.recordset")
sqldudan="select * from dudan where gamepl="" "
rsdudan.open sqldudan,conn1,1,3

gameid=rsdudan("gameid")
game1=rsdudan("game1")
game2=rsdudan("game2")
username=rsdudan("username")
duzu=rsdudan("duzhu")
set rscup=server.createobject("adodb.recordset")

sqlcup="select * from game where id="&gameid&""
rscup.open sqlcup,conn1,1,3

hteam=rscup("hteamrate")
vteam=rscup("vteamrate")
text1=rscup("pteamrate")
ending=rscup("ending")
score1=rscup("score")
rscup.close
if game1=ending then
win=1
lost=0
else
win=0
lost=1
end if
if ending = 1 then
result=hteam*duzu
elseif ending = 2 then
result=vteam*duzu
elseif ending = 3 then
result=pteam*duzu
end if

if game1=ending and game2=score1 then
result=result*1.2-duzu
elseif game1=ending and game2<>score1 then
result=result-duzu
else
result=0-duzu
end if
set rswinuser=server.createobject("adodb.recordset")
sqlwinuser="select * from winuser where username="&username&""
rswinuser.open sqlwinuser,conn1,1,3

if rswinuser.eof then
rswinuser.addnew
rswinuser("username")=username
rswinuser("money")=duzu
rswinuser("win")=win
rswinuser("lost")=lost
rswinuser("totalwin")=result
rswinuser.update
rswinuser.close
else
rswinuser("money")=rswinuser("money")+duzu
rswinuser("win")=rswinuser("win")+win
rswinuser("lost")=rswinuser("lost")+lost
rswinuser("totalwin")=rswinuser("totalwin")+result
rswinuser.update
rswinuser.close
end if

rsdudan.movenext
loop

%>
<%=total%>

运行后内部服务器错误,是哪句出了问题呢?望能指教

sqldudan="select * from dudan where gamepl="" "
这句sQL取不到数据,后面也没有判断是否空集