Problemer med select case
HalløjMin form returnerer vist ikke den rigtige case værdi. Hvad går galt??
<% if mode = "rediger" then %>
<%
Set abConn = Server.CreateObject("ADODB.Connection")
abonConn = "PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("brugere.mdb") & ";UID=;PWD=;"
strSQL = "SELECT * FROM nyhed WHERE (BrugerID = " & Request.QueryString("brugerid") & ")"
abConn.Open abonConn
Set rs = abConn.Execute(strSQL)
If Not (rs.BOF Or rs.EOF) Then
do While Not rs.EOF
%>
<form method=post action=brugere.asp?mode=rediger_process&brugerid=<%= rs("brugerid") %> id=form1 name=form1>
<%
nyt = rs("nyt")
menu = rs("menu")
Response.Write "<span class=text>Herunder kan du redigere dine bruger oplysninger</span>"
response.write "<table>"
response.write "<tr><td colspan=2 bgcolor=#C2B26A class=text>Rediger brugeroplysninger</td></tr>"
response.write "<tr><td><span class=text>Navn:</td><td> <input type=text name=navn value='" & rs("navn") & "'></td></tr>"
response.write "<tr><td><span class=text>Login:</td><td> <input type=text name=login value=" & rs("Login") & "></td></tr>"
response.write "<tr><td><span class=text>Password:</td><td> <input type=password name=password value=" & rs("password") & "></td></tr>"
response.write "<tr><td><span class=text>Email:</td><td> <input type=text name=email value=" & rs("email") & "></td></tr><br><br>"
response.write "<tr><td colspan=2><span class=subheader>Abonnementer:</td><td></span>"
%>
<tr><td colspan=2><span class=text>Nyt på AIDA: <INPUT TYPE="checkbox" NAME="nyt" value="yes" <% If nyt = "True" Then %> CHECKED<% End If %>><br>
Kantinens menu: <INPUT TYPE="checkbox" NAME="menu" value="yes" <% If menu = "True" Then %> CHECKED<% End If %>></span></td></tr></table>
<input type=submit value=Opdater name=action> <input type=submit value=Slet name=action><input type="button" value="Annuller" name="Annuller" onClick="java script:history.back();">
<input type=hidden name=transfer value="<%= rs("transfer") %>">
</form>
<%
rs.MoveNext
Loop
Else
Response.Write "<p><font face=arial size=2></font></p>"
End If
abconn.Close
%>
<% end if %>
<% if mode = "rediger_process" then %>
<%
Dim strAction
strAction = UCase(Left(Request.Form("action"),4))
Select Case strAction
Case "SLET"
Set delConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
delConn.Open "DSN=brugere"
sql = "delete from nyhed WHERE brugerID= "& request("brugerid")
delconn.execute (SQL)
Case "OPDA"
if Request.Form("navn") <> "" and Request.Form("login") <> "" and Request.Form("password") <> "" and Request.Form("email") <> "" then
navn = request.form("navn")
login = request.form("login")
password = request.form("password")
email = request.form("email")
if request.form("nyt") = "yes" then
nyt = 1
else
nyt = 0
end if
if request.form("menu") = "yes" then
menu = 1
else
menu = 0
end if
Set upConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
upConn.Open "DSN=brugere"
sql = "update nyhed set navn = '" & Request.form("navn") & "', login = '" & Request.form("login") & "', password = '" & Request.form("password") & "', email = '" & Request.form("email") & "', transfer = '" & Request.form("transfer") & "', nyt = '"&nyt&"', menu = '"&menu&"' WHERE brugerID= "& Request("brugerid")
upconn.execute (SQL)
Response.Write "<span class=text>Dine brugeroplysninger er opdateret</span>"
else
Response.Write "<span class=text>Du har ikke udfyldt alle oplysninger</span>"
end if
end select
%>
<% end if %>