Redirect og variabeloverførsel
Kan ikke få min variabel RSId med over på asp-side 2.Ville glæde mig meget hvis nogen ku se fejlen i min kode.
Min kode:
<%
' side_1.asp
'Oprettelse af connection
'------------------------
dim conn,rs,x,RSId
set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.Jet.OLEDB.4.0"
conn.open(server.mappath("/Basen.mdb"))
set rs=Server.CreateObject("ADODB.Recordset")
SQL = "INSERT into ordrer ("
SQL = SQL + "navn,"
SQL = SQL + "adresse,"
SQL = SQL + "bem"
SQL = SQL + ") VALUES ('"
SQL = SQL + Request.Form("navn") + "','"
SQL = SQL + Request.Form("adresse") + "','"
SQL = SQL + Request.Form("bem") + "')"
Conn.Execute(SQL)
Set rs = nothing
Set RSId = Conn.Execute("SELECT @@IDENTITY as Id FROM tabel")
' send det nye id videre:
response.redirect("side_2.asp?RSId=" & Id)
Conn.Close
Set Conn = Nothing
%>
<%
'side_2.asp
Response.Write "Ha Ha"
response.write Request.QueryString("RSId")
%>
