Updata db i asp
Her er min update men kan ikke få den til at virkeHar fået af hvide jeg skal bruge den sådan
strSQL = "Update personer set "
strSQL = strSQL & "Fornavn= 'A.', "
strSQL = strSQL & "Telefon= '44444444' "
strSQL = strSQL & " Where Id = 24"
Men så skal jeg havde id på en måde?!
<%
DIM strtitel, strSQL
strtitel = Request.Form("titel")
IF strtitel <> "" THEN
dim cn
set cn = server.CreateObject("adodb.connection")
cn.connectionstring = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\filmdatabase\databese\db.mdb"
cn.open
strSQL = "Update film set ("
strSQL = strSQL & "film_titel, "
strSQL = strSQL & "film_instruktør, "
strSQL = strSQL & "film_spilletid, "
strSQL = strSQL & "film_genre, "
strSQL = strSQL & "film_format, "
strSQL = strSQL & "film_år, "
strSQL = strSQL & "film_codex, "
strSQL = strSQL & "film_info, "
strSQL = strSQL & "film_lyd, "
strSQL = strSQL & "film_cder, "
strSQL = strSQL & "film_bedømmelse, "
strSQL = strSQL & "film_land, "
strSQL = strSQL & "film_skuespiller, "
strSQL = strSQL & "film_brugernavn) "
strSQL = strSQL & "values( "
strSQL = strSQL & "'" & Request.Form("titel") &"', "
strSQL = strSQL & "'" & Request.Form("instruktør") &"', "
strSQL = strSQL & "'" & Request.Form("spilletid") &"', "
strSQL = strSQL & "'" & Request.Form("genre") &"', "
strSQL = strSQL & "'" & Request.Form("format") &"', "
strSQL = strSQL & "'" & Request.Form("år") &"', "
strSQL = strSQL & "'" & Request.Form("codex") &"', "
strSQL = strSQL & "'" & Request.Form("info") &"', "
strSQL = strSQL & "'" & Request.Form("lyd") &"', "
strSQL = strSQL & "'" & Request.Form("cder") &"', "
strSQL = strSQL & "'" & Request.Form("bedømmelse") &"', "
strSQL = strSQL & "'" & Request.Form("land") &"', "
strSQL = strSQL & "'" & Request.Form("skuespiller") &"', "
strSQL = strSQL & "'" & Request.Form("brugernavn") &"')"
cn.execute strSQL
cn.close
set cn = Nothing
Response.Redirect "index.asp"
ELSE
%>
<html width="550">
<tr width="550">
<td width="550">
<%
Response.Write "<p>Du har ikke udfyldt føljene felter: TRYK PÅ TILBAGE OG UDFYLD FELTERNE</p>"
IF strtitel <> "" THEN
ELSE
Response.Write ("strsql")
Response.Write "<b>• Titel :: Du skal skrive en titel på filmen.</b><br>"
END IF
%>
</td>
</tr>
</html>
<%
END IF
%>
