Hvorfor vil den ikke sætte teksten fra felterne ind i min database?
<%
mode = request("mode")
if mode = "" Then
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("database/database.mdb")
Conn.Open DSN
Dim samletAntal
strSQL = "SELECT * FROM interesser WHERE id=" & session("id")
Set rs = Conn.Execute(strSQL)
interesse_01 = RS("interesse_01")
interesse_02 = RS("interesse_02")
interesse_03 = RS("interesse_03")
interesse_04 = RS("interesse_04")
interesse_05 = RS("interesse_05")
interesse_06 = RS("interesse_06")
interesse_07 = RS("interesse_07")
interesse_08 = RS("interesse_08")
interesse_09 = RS("interesse_09")
interesse_10 = RS("interesse_10")
Response.Write "<form method=post action=""rediger_interesser.asp?mode=2"">"
Response.Write "<b>Interesser:</b><br><br>"
Response.Write "Interesse 01:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_01 & "><br><br>"
Response.Write "Interesse 02:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_02 & "><br><br>"
Response.Write "Interesse 03:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_03 & "><br><br>"
Response.Write "Interesse 04:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_04 & "><br><br>"
Response.Write "Interesse 05:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_05 & "><br><br>"
Response.Write "Interesse 06:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_06 & "><br><br>"
Response.Write "Interesse 07:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_07 & "><br><br>"
Response.Write "Interesse 08:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_08 & "><br><br>"
Response.Write "Interesse 09:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_09 & "><br><br>"
Response.Write "Interesse 10:<br>"
Response.Write "<input type=text name=T1 size=20 maxlength=50 class=input value=" & interesse_10 & "><br><br>"
Response.Write "<input type=submit value=Gem class=button>"
Response.Write "</form>"
Conn.Close
Set Conn = Nothing
End if
if mode = "2" Then
fejl = false
interesse_01 = Request.Form("interesse_01")
interesse_02 = Request.Form("interesse_02")
interesse_03 = Request.Form("interesse_03")
interesse_04 = Request.Form("interesse_04")
interesse_05 = Request.Form("interesse_05")
interesse_06 = Request.Form("interesse_06")
interesse_07 = Request.Form("interesse_07")
interesse_08 = Request.Form("interesse_08")
interesse_09 = Request.Form("interesse_09")
interesse_10 = Request.Form("interesse_10")
If Trim(interesse_01) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_02) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_03) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_04) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_05) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_06) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_07) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_08) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_09) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
If Trim(interesse_10) = "" Then
Response.Redirect("rediger_interesser.asp?mode=4")
fejl = true
End If
if fejl = false then
information = Replace(information, "'", "''")
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("database/database.mdb")
Conn.Open DSN
strSQL = "UPDATE interesser SET interesse_01='" & Request.Form("interesse_01") & "', interesse_02='" & Request.Form("interesse_02") & "', interesse_03='" & Request.Form("interesse_03") & "', interesse_04='" & Request.Form("interesse_04") & "', interesse_05='" & Request.Form("interesse_05") & "', interesse_06='" & Request.Form("interesse_06") & "', interesse_07='" & Request.Form("interesse_07") & "', interesse_08='" & Request.Form("interesse_08") & "', interesse_09='" & Request.Form("interesse_09") & "', interesse_10='" & Request.Form("interesse_10") & "' WHERE id = " & Session("id") & ""
Conn.Execute(strSQL)
Conn.Close
Set Conn = Nothing
Response.Redirect "rediger_interesser.asp?mode=3"
End if
End if
if mode = "3" Then
Response.Write "<b>#NOTE:</b> Dine interesse blev rettet."
End if
if mode = "4" Then
Response.Write "<b>#NOTE:</b> <font color=red>Fejl i et af felterne.</font>"
End if
%>