opdatere data forkert
Jeg kan ikke overskue det længere !!!Der er en fejl i dette, den opdatere dataen fra træningskampen både som pokal kamp og træningskamp, samt den siger der er fejl i min UPDATE sætning.
Er der en med friske øjne som kan hjælpe !!
<%
if session(\"login\") = 1 then
set DB = Server.CreateObject(\"ADODB.Connection\")
DB.open \"Driver={Microsoft Access Driver (*.mdb)};\"&_
\"DBQ=\"&server.mappath(\"trippendales.mdb\")&\";\"&_
\"DefaultDir=\"&server.mappath(\"./\")&\";FIL=MS Access;\"
strHold = Request.querystring(\"hold\")
strKamp = Request.querystring(\"kamp\")
If Request(\"Action\") = \"Send\" Then
SQL5 = \"Select count(*) as Antal from fct\"
Set RS5 = DB.Execute(SQL5)
b=RS5(\"Antal\")
\'OPDATERE HVER SPILLER SOM HAR VÆRET MED I EN TURNERINGSKAMP....
if Request.querystring(\"kamp\")=\"turn\" then
if Len(Request(\"hj_res\")) <> 0 AND Len(Request(\"ude_res\")) <> 0 then
\'OPDATERER KAPRESULTATET
SQL7=\"Update kampe\"&Request.querystring(\"hold\")&\" Set hj_res =\"&Request(\"hj_res\")&\", ude_res=\"&Request(\"ude_res\")&\" where id=\"&Request(\"Hjem\")
DB.execute(SQL7)
for a= 1 to b
if Request.form(\"del_\"&a&\"\")=\"ON\" then
if Request(\"maal\"&a&\"\")=\"\" then
maal=0
else
maal=Request(\"maal\"&a&\"\")
end if
if Request(\"100_\"&a&\"\")=\"\" then
str100=0
else
str100=Request(\"100_\"&a&\"\")
end if
if Request(\"drop\"&a&\"\")=\"\" then
drop=0
else
drop=Request(\"drop\"&a&\"\")
end if
SQL12=\"Select * from kampe\"&Request.querystring(\"hold\")&\" where id=\"&Request(\"hjem\")
set RS12 = DB.execute(SQL12)
SQL6 = \"SELECT * FROM runde\"&Request(\"hjem\")&\"_\"&Request.querystring(\"hold\")
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open SQL6, DB, 3, 3
DB1.AddNew
DB1(\"id\")=a
DB1(\"maal\")=maal
DB1(\"100\")=str100
DB1(\"Drop\")=drop
DB1(\"sent\")=Request(\"sent\"&a&\"\")
DB1(\"rodt\")=Request(\"rodt\"&a&\"\")
DB1(\"gult\")=Request(\"gult\"&a&\"\")
DB1(\"div\")=Request(\"div\"&a&\"\")
if RS12(\"hjemme\")=\"Trippendales\" then
maal_imod=Request.form(\"ude_res\")
else
maal_imod=Request.form(\"hj_res\")
end if
DB1(\"maal_imod\")=maal_imod
intIalt=maal_imod*3+str100*10+drop*10+Request(\"sent\"&a&\"\")*Request(\"sent\"&a&\"\")*3+Request(\"rodt\"&a&\"\")*50+Request(\"gult\"&a&\"\")*20+Request(\"div\"&a&\"\")
DB1(\"ialt\")=intIalt
DB1.update
strSQL = \"SELECT * FROM skylder Where id=\"&a
set RS8 = DB.execute(strSQL)
if RS8.eof then
strSQL1 = \"SELECT * FROM skylder\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open strSQL1, DB, 3, 3
DB1.AddNew
DB1(\"id\")=a
DB1(\"ialt\")=intIalt
DB1(\"maal\")=maal
DB1(\"100\")=str100
DB1(\"Drop\")=drop
DB1(\"sent\")=Request(\"sent\"&a&\"\")
DB1(\"rodt\")=Request(\"rodt\"&a&\"\")
DB1(\"gult\")=Request(\"gult\"&a&\"\")
DB1(\"div\")=Request(\"div\"&a&\"\")
DB1(\"maal_imod\")=Request.form(\"ude_res\")
DB1.update
else
SQL10 = \"Select * From skylder where id=\"&a
Set RS10 = DB.Execute(SQL10)
skylder=RS10(\"ialt\")+intIalt
maalialt=RS10(\"maal\")+maal
str100ialt=RS10(\"100\")+str100
dropialt=RS10(\"drop\")+drop
sentialt=RS10(\"sent\")+Request(\"sent\"&a&\"\")
rodtialt=RS10(\"rodt\")+Request(\"rodt\"&a&\"\")
gultialt=RS10(\"gult\")+Request(\"gult\"&a&\"\")
divialt=RS10(\"div\")+Request(\"div\"&a&\"\")
maal_imodialt=RS10(\"maal_imod\")+Request(\"ude_res\")
betalt=RS10(\"betalt\")
SQL9=\"Update skylder Set ialt=\'\"&skylder&\"\', betalt=\'\"&betalt&\"\', maal=\'\"&maalialt&\"\', 100=\'\"&str100ialt&\"\', drop=\'\"&dropialt&\"\', sent=\'\"&sentialt&\"\', rodt=\'\"&rodtialt&\"\', gult=\'\"&gultialt&\"\', div=\'\"&divialt&\"\', maal_imod=\'\"&maal_imodialt&\"\' where id=\"&a
DB.execute(SQL9)
end if
end if
next
else
strErr=\"Du mangler at udfylde resultatet i denne turneringskamp\"
end if
end if
\'OPDATERE HVER SPILLER SOM HAR VÆRET MED I EN POKALKAMP....
if Request.querystring(\"kamp\")=\"pok\" then
\'if Len(Request(\"pokal_modst\")) <> 0 AND Len(Request(\"hj_res_pok\")) <> 0 AND Len(Request(\"ude_res_pok\")) <> 0 AND Len(Request(\"dato_pok\")) <> 0 then
SQL18 = \"SELECT * FROM pokal\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open SQL18, DB, 3, 3
DB1.AddNew
DB1(\"modstander\")=Request(\"pokal_modst\")
DB1(\"trip_res\")=Request(\"hj_res_pok\")
DB1(\"mod_res\")=Request(\"ude_res_pok\")
DB1(\"dato\")=Request(\"dato_pok\")
DB1.update
for a= 1 to b
if Request.form(\"del_\"&a&\"\")=\"ON\" then
if Request(\"maal\"&a&\"\")=\"\" then
maal=0
else
maal=Request(\"maal\"&a&\"\")
end if
if Request(\"100_\"&a&\"\")=\"\" then
str100=0
else
str100=Request(\"100_\"&a&\"\")
end if
if Request(\"drop\"&a&\"\")=\"\" then
drop=0
else
drop=Request(\"drop\"&a&\"\")
end if
SQL181=\"SELECT top 1 * FROM pokal order by id DESC\"
set RS181 = DB.execute(SQL181)
SQL19 = \"SELECT * FROM runde_pokal\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open SQL19, DB, 3, 3
DB1.AddNew
DB1(\"id\")=a
DB1(\"maal\")=maal
DB1(\"100\")=str100
DB1(\"Drop\")=drop
DB1(\"sent\")=Request(\"sent\"&a&\"\")
DB1(\"rodt\")=Request(\"rodt\"&a&\"\")
DB1(\"gult\")=Request(\"gult\"&a&\"\")
DB1(\"div\")=Request(\"div\"&a&\"\")
DB1(\"maal_imod\")=Request.form(\"ude_res_pok\")
DB1(\"kamp_id\")=RS181(\"id\")
maal_imod=Request(\"ude_res_pok\")
intIalt=maal_imod*3+str100*10+drop*10+Request(\"sent\"&a&\"\")*Request(\"sent\"&a&\"\")*3+Request(\"rodt\"&a&\"\")*50+Request(\"gult\"&a&\"\")*20+Request(\"div\"&a&\"\")
DB1(\"ialt\")=intIalt
DB1.update
strSQL = \"SELECT * FROM skylder Where id=\"&a
set RS8 = DB.execute(strSQL)
if RS8.eof then
strSQL1 = \"SELECT * FROM skylder\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open strSQL1, DB, 3, 3
DB1.AddNew
DB1(\"id\")=a
DB1(\"ialt\")=intIalt
DB1(\"maal\")=maal
DB1(\"100\")=str100
DB1(\"Drop\")=drop
DB1(\"sent\")=Request(\"sent\"&a&\"\")
DB1(\"rodt\")=Request(\"rodt\"&a&\"\")
DB1(\"gult\")=Request(\"gult\"&a&\"\")
DB1(\"div\")=Request(\"div\"&a&\"\")
DB1(\"maal_imod\")=Request(\"ude_res_pok\")
DB1.update
else
SQL10 = \"Select * From skylder where id=\"&a
Set RS10 = DB.Execute(SQL10)
skylder=RS10(\"ialt\")+intIalt
maalialt=RS10(\"maal\")+maal
str100ialt=RS10(\"100\")+str100
dropialt=RS10(\"drop\")+drop
sentialt=RS10(\"sent\")+Request(\"sent\"&a&\"\")
rodtialt=RS10(\"rodt\")+Request(\"rodt\"&a&\"\")
gultialt=RS10(\"gult\")+Request(\"gult\"&a&\"\")
divialt=RS10(\"div\")+Request(\"div\"&a&\"\")
maal_imodialt=RS10(\"maal_imod\")+Request(\"ude_res_traen\")
betalt=RS10(\"betalt\")
SQL9=\"Update skylder Set ialt=\"&skylder&\", betalt=\"&betalt&\", maal=\"&maalialt&\", 100=\"&str100ialt&\", drop=\"&dropialt&\", sent=\"&sentialt&\", rodt=\"&rodtialt&\", gult=\"&gultialt&\", div=\"&divialt&\", maal_imod=\"&maal_imodialt&\" where id=\"&a
DB.execute(SQL9)
end if
end if
next
strErr=\"\"
\'else
\' strErr=\"Du mangler at udfylde et eller flere felter i denne pokalkamp\"
\'end if
end if
\'OPDATERE HVER SPILLER SOM HAR VÆRET MED I EN TRÆNINGSSKAMP....
if Request.querystring(\"kamp\")=\"traen\" then
\'if Len(Request(\"traen_modst\")) <> 0 AND Len(Request(\"hj_res_traen\")) <> 0 AND Len(Request(\"ude_res_traen\")) <> 0 AND Len(Request(\"dato_traen\")) <> 0 then
SQL16 = \"SELECT * FROM traen\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open SQL16, DB, 3, 3
DB1.AddNew
DB1(\"modstander\")=Request(\"traen_modst\")
DB1(\"trip_res\")=Request(\"hj_res_traen\")
DB1(\"mod_res\")=Request(\"ude_res_traen\")
DB1(\"dato\")=Request(\"dato_traen\")
DB1.update
for a= 1 to b
if Request.form(\"del_\"&a&\"\")=\"ON\" then
if Request(\"maal\"&a&\"\")=\"\" then
maal=0
else
maal=Request(\"maal\"&a&\"\")
end if
if Request(\"100_\"&a&\"\")=\"\" then
str100=0
else
str100=Request(\"100_\"&a&\"\")
end if
if Request(\"drop\"&a&\"\")=\"\" then
drop=0
else
drop=Request(\"drop\"&a&\"\")
end if
SQL161=\"SELECT top 1 * FROM traen order by id DESC\"
set RS161 = DB.execute(SQL161)
SQL17 = \"SELECT * FROM runde_traen\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open SQL17, DB, 3, 3
DB1.AddNew
DB1(\"id\")=a
DB1(\"maal\")=maal
DB1(\"100\")=str100
DB1(\"Drop\")=drop
DB1(\"sent\")=Request(\"sent\"&a&\"\")
DB1(\"rodt\")=Request(\"rodt\"&a&\"\")
DB1(\"gult\")=Request(\"gult\"&a&\"\")
DB1(\"div\")=Request(\"div\"&a&\"\")
DB1(\"maal_imod\")=Request(\"ude_res_traen\")
DB1(\"kamp_id\")=RS161(\"id\")
maal_imod=Request(\"ude_res_traen\")
intIalt=maal_imod*3+str100*10+drop*10+Request(\"sent\"&a&\"\")*Request(\"sent\"&a&\"\")*3+Request(\"rodt\"&a&\"\")*50+Request(\"gult\"&a&\"\")*20+Request(\"div\"&a&\"\")
DB1(\"ialt\")=intIalt
DB1.update
strSQL = \"SELECT * FROM skylder Where id=\"&a
set RS8 = DB.execute(strSQL)
if RS8.eof then
strSQL1 = \"SELECT * FROM skylder\"
Set DB1 = Server.CreateObject(\"ADODB.Recordset\")
DB1.Open strSQL1, DB, 3, 3
DB1.AddNew
DB1(\"id\")=a
DB1(\"ialt\")=intIalt
DB1(\"maal\")=maal
DB1(\"100\")=str100
DB1(\"Drop\")=drop
DB1(\"sent\")=Request(\"sent\"&a&\"\")
DB1(\"rodt\")=Request(\"rodt\"&a&\"\")
DB1(\"gult\")=Request(\"gult\"&a&\"\")
DB1(\"div\")=Request(\"div\"&a&\"\")
DB1(\"maal_imod\")=Request(\"ude_res_traen\")
\'Request(\"ude_res_traen\")
DB1.update
else
SQL10 = \"Select * From skylder where id=\"&a
Set RS10 = DB.Execute(SQL10)
skylder=RS10(\"ialt\")+intIalt
maalialt=RS10(\"maal\")+maal
str100ialt=RS10(\"100\")+str100
dropialt=RS10(\"drop\")+drop
sentialt=RS10(\"sent\")+Request(\"sent\"&a&\"\")
rodtialt=RS10(\"rodt\")+Request(\"rodt\"&a&\"\")
gultialt=RS10(\"gult\")+Request(\"gult\"&a&\"\")
divialt=RS10(\"div\")+Request(\"div\"&a&\"\")
maal_imodialt=RS10(\"maal_imod\")+Request(\"ude_res_traen\")
betalt=RS10(\"betalt\")
SQL9=\"Update skylder Set ialt=\"&skylder&\", betalt=\"&betalt&\", maal=\"&maalialt&\", 100=\"&str100ialt&\", drop=\"&dropialt&\", sent=\"&sentialt&\", rodt=\"&rodtialt&\", gult=\"&gultialt&\", div=\"&divialt&\", maal_imod=\"&maal_imodialt&\" where id=\"&a
DB.execute(SQL9)
end if
end if
next
strErr=\"\"
\'else
\'strErr=\"Du mangler at udfylde et eller flere felter i denne træningskamp\"
\'end if
end if
response.write(\"<font color=\"\"red\"\">\"&strErr&\"</font>\")
end if
If Request.Form(\"Action\") = \"Vælg\" Then
SQL5 = \"Select count(*) as Antal from fct\"
Set RS5 = DB.Execute(SQL5)
b=RS5(\"Antal\")
strString=\"&\"
for q=1 to b
if Request.form(\"del_\"&q&\"\")=\"ON\" then
strString=\"\"&strString&\"id_\"&q&\"=ok&\"
end if
next
response.redirect(\"bodekasse.asp?valgt=ja\"&strString&\"hold=1&kamp=\"&Request(\"R1\"))
end if
%>
