Problemer med update
Hvorfor hulen virker denne update sætning ikke:<% if mode="aktivitet_rediger" then %>
<%
Set myConn = Server.CreateObject("ADODB.Connection")
strSQL = "SELECT * FROM aktivitetsliste WHERE (ID = " & Request.QueryString("id") & ")"
myConn.Open tempConn
Set rs = myConn.Execute(strSQL)
If Not (rs.BOF Or rs.EOF) Then
Response.Write "<form method=POST action=forside.asp?mode=update&ID=" & Request.QueryString("id") & ">"
Response.Write "<table width=450>"
do While Not rs.EOF
Response.Write "<tr><td width=40 valign=top><span class=text>Ugedag:</td><td width=410>" & "<input size=4 name=ugedag value=" & rs("ugedag") & ">" & "</td></tr>"
Response.Write "<tr><td valign=top><span class=text>Teaser:</td><td>" & "<TEXTAREA name=teaser cols=25 rows=10>" & rs("teaser") & "</textarea></td></tr>"
Response.Write "<tr><td valign=top><span class=text>Beskrivelse:</td><td>" & "<TEXTAREA name=beskrivelse cols=25 rows=10>" & rs("beskrivelse") & "</textarea></td></tr>"
Response.Write "<tr><td valign=top><span class=text>Ugenr.:</td><td>" & "<input size=4 name=ugenr value=" & rs("ugenr") & ">" & "</td></tr>"
rs.MoveNext
Loop
Response.Write "</table>"
Else
Response.Write "<p><font face=arial size=2></font></p>"
End If
myConn.Close
Set myConn = Nothing
%>
<input type="submit" value="Gem" name="Gem">
<input type="button" value="Annuller" name="Annuller" onClick="java script:history.back();">
</form>
<% end if %>
<% if mode = "update" then %>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
conn.Open "DBQ="&(Server.MapPath(".")) &"\news2.mdb; DefaultDir=DBQ="&(Server.MapPath(".")) &"\;Driver={Microsoft Access Driver (*.mdb)};"
SQL = "UPDATE aktivitetsliste set ugedag = '" & Request.form("ugedag") & "', teaser = '" & Request.form("teaser") & "', beskrivelse = '" & Request.form("beskrivelse") & "', ugenr = '" & Request.form("ugenr") & "' WHERE ID= "& request("id")
conn.execute (SQL)
SQL = "SELECT * from aktivitetsliste"
RS.Open SQL, Conn
On Error Resume Next
RS.MoveFirst
Do While NOT RS.EOF
Exit Do
RS.MoveNext
Loop
%>
<p class=text>Så er aktivitetslisten opdateret</p>
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=http://aida/forside.asp?mode=ativitet_admin">
<% end if %>
Jeg får en fejl der lyder:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access-driver] Handlingen skal bruge en opdaterbar forespørgsel.
/forside.asp, line 447