webForumDet fria alternativet

gå tillbaka till id

ASP

5 svar · 332 visningar · startad av hatti

Medlem sedan jan. 200164 inlägg
Frågan#1

hej kör ett script där jag gör ett match protokoll och tar ena databas id:t och gör om till gameid till nästa databas men nu är det så att när jag gör responce.redirect för att komma tillbaka till matchen får jag inte med mig id:t vad e fel

adressen som skickar
........../Intranet/matchrapport_4_goal.asp?GameID=21
------------------------------------------------------------------

till scriptet

<!-- #include file="adovbs.inc" -->

<%
ID2 = Request.QueryString("GameId")

Set Connect = Server.CreateObject("ADODB.Connection") 
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("../../../DB/A-Lag.mdb")&";"

Set RecSet = Server.CreateObject("ADODB.Recordset")

Addera = "Select * From game_events"
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic

	RecSet.AddNew

	RecSet("GameID") = Request.Form("GameID")
	RecSet("GoalPeriod") = Request.Form("GoalPeriod")
	RecSet("GoalMin") = Request.Form("GoalMin")
	RecSet("GoalSec") = Request.Form("GoalSec")
	RecSet("GoalPlayer") = Request.Form("GoalPlayer")
	RecSet("GoalTeam") = Request.Form("GoalTeam")
	RecSet("GoalResultH") = Request.Form("GoalResultH")
	RecSet("GoalResultA") = Request.Form("GoalResultA")
	RecSet("GoalAssPlayer1") = Request.Form("GoalAssPlayer1")
	RecSet("GoalAssPlayer2") = Request.Form("GoalAssPlayer2")
	RecSet("PenPeriod") = Request.Form("PenPeriod")
	RecSet("PenMin") = Request.Form("PenMin")
	RecSet("PenSec") = Request.Form("PenSec")
	RecSet("PenSec") = Request.Form("PenSec")
	RecSet("PenTeam") = Request.Form("PenTeam")
	RecSet("PenLength") = Request.Form("PenLength")
	RecSet("PenReason") = Request.Form("PenReason")

	RecSet.Update
	RecSet.Close

Connect.Close
	Set RecSet = nothing
	Set Connect = nothing

Response.Redirect "../Intranet/matchrapport_3.asp?id=" & ID2

%>

men sedan kommer jag tillbaka till sidan

............../Intranet/matchrapport_3.asp?id=

problemet är att id:t inte följer med hittar inte felet

Medlem sedan juni 200032 967 inlägg
#2

Det lär väl vara denna rad det är fel på:

ID2 = Request.QueryString("GameId")

Skickar du querystringen GameId till denna sida?

Medlem sedan jan. 200164 inlägg
#3

här är sidan som skickar

<!-- #include file="adovbs.inc" -->
<html>
<head>
<title>Untitled Document</title>
<LINK REL="stylesheet" HREF="../../../formatmall1.css">
</head>

<body>
<%
	   

ID2 = Request.QueryString("GameId")

Set Connect = Server.CreateObject("ADODB.Connection") 
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("../../../DB/A-Lag.mdb")&";"

Set RecSet = Server.CreateObject("ADODB.Recordset")

Addera = "Select * From game_events"
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic

%>
<FORM name="form1" action="../scripts/matchrapport_4_goal.asp?id=<%=ID2%>" method="post">
  <table width="429" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><TABLE width="420" align="center" cellPadding=3 cellSpacing=1 bgcolor="#000066">
          <TR bgcolor="#000066">
		  <%
RecSet.Close
Connect.Close
Set RecSet = nothing
Set Connect = nothing
%>
            <TD width="50%" bgcolor="#000066"><B><strong><font color="#FFFFFF"></font></strong></B></TD>
            <TD width="50%"> <div align="right"><font color="#ffffff" size="1" face="Verdana, Arial, Helvetica, sans-serif">Anv:<%=Session("FirstName")%>&nbsp;<%=Session("LastName")%></font></div></TD>
          </TR>
        </TABLE>
        <table width="420" border="0" align="center" cellpadding="3" cellspacing="1">
          <tr>
            <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Registrera 
              m&aring;l, m&aring;lg&ouml;rare och assisterande m&aring;lg&ouml;rare</strong></font></td>
          </tr>
        </table>
        <table width="420" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000066">
          <tr> 
            <td width="48" bgcolor="#000066"> <div align="center"> 
                <p><font color="#FFFFFF"><strong>Period</strong></font></p>
              </div></td>
            <td width="98" bgcolor="#000066"> <div align="center"> 
                <p><strong><font color="#FFFFFF">Tid</font></strong></p>
              </div></td>
            <td width="13" bgcolor="#000066"> <div align="center"> 
                <p><strong><font color="#FFFFFF">Nr</font></strong></p>
              </div></td>
            <td width="42" bgcolor="#000066"> <div align="center"> 
                <p><strong><font color="#FFFFFF">Lag</font></strong></p>
              </div></td>
            <td width="85" bgcolor="#000066"> <div align="center"> 
                <p><strong><font color="#FFFFFF">Resultat</font></strong></p>
              </div></td>
            <td width="34" bgcolor="#000066"> <div align="center"> 
                <p><strong><font color="#FFFFFF">Pass1</font></strong></p>
              </div></td>
            <td width="34" bgcolor="#000066"> <div align="center"> 
                <p><strong><font color="#FFFFFF">Pass2</font></strong></p>
              </div></td>
          </tr>
        </table>
        <table width="420" border="0" align="center" cellpadding="3" cellspacing="1">
          <tr> 
            <td width="48"><div align="center"> 
                <p> 
                  <select name="GoalPeriod" id="GoalPeriod">
                    <option>1</option>
                    <option>2</option>
                    <option>3</option>
                    <option>SD</option>
                  </select>
                  <input name="GameID" type="hidden" value="<%=ID2%>" size="1" maxlength="10">
                </p>
              </div></td>
            <td width="98"><div align="center"> 
                <p> 
                  <input name="GoalMin" type="text" id="GoalMin" size="1" maxlength="2">
                  : 
                  <input name="GoalSec" type="text" id="GoalSec" size="1" maxlength="2">
                </p>
              </div></td>
            <td width="13"><div align="center"> 
                <p> 
                  <input name="GoalPlayer" type="text" id="GoalPlayer" size="1" maxlength="2">
                </p>
              </div></td>
            <td width="42"><div align="center"> 
                <p> 
                  <select name="GoalTeam" id="GoalTeam">
                    <option>A</option>
                    <option>B</option>
                  </select>
                </p>
              </div></td>
            <td width="85"><div align="center"> 
                <p> 
                  <input name="GoalResultH" type="text" id="GoalResultH" size="1" maxlength="2">
                  - 
                  <input name="GoalResultA" type="text" id="GoalSec3" size="1" maxlength="2">
                </p>
              </div></td>
            <td width="34"><div align="center"> 
                <p> 
                  <input name="GoalAssPlayer1" type="text" id="GoalAssPlayer1" size="1" maxlength="2">
                </p>
              </div></td>
            <td width="34"><div align="center"> 
                <p> 
                  <input name="GoalAssPlayer2" type="text" id="GoalAssPlayer2" size="1" maxlength="2">
                </p>
              </div></td>
          </tr>
        </table>
        <table width="420" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">-</font></td>
          </tr>
        </table>
        <table width="420" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td><div align="right"> 
                <input name="Submit" type="submit" id="Submit" value="Skicka">
                <input name="Reset" type="reset" id="Reset" value="Rensa">
              </div></td>
          </tr>
        </table>
        
      </td>
    </tr>
  </table>
  </form>
<p>&nbsp;</p>
<p>&nbsp; </p>
</body>
</html>
Medlem sedan jan. 200164 inlägg
#4

fungerar nu

Medlem sedan nov. 20017 144 inlägg
#5

Och som alltid skriver man en förklaring till vad som löste problemet för att ev. någon med liknande problem skall bli lite klokare. ;)

Medlem sedan jan. 200164 inlägg
#6

det var gaeid som var fel skulle vara
ID2 = Request.QueryString("id")

259 ms totalt · 4 externa anrop · v20260731065814-full.6fe65c25
123 ms — deklarationer (db)
0 ms — hämta statistik (cache)
134 ms — hämta tråd, inlägg och bilagor (db)
123 ms — ändringar (db)