Datatyperne stemmer ikke overens i kriterieudtrykket.
jeg har problemer med noget sql og opdateringen af en databasemin form jeg opdatere fra:
<table border="0" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt;" width="460" cellpadding="0" cellspacing="0">
<tr><td width="70"><em><b><u><input type=hidden value="<%=request("id")%>">Boks nr: <%=rs1("boks")%></em></u></b></td><td width="100"></td><td width="20"><input type="submit" name="action" value="opdatere" class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000"></td><td width="17"><input type="reset" name="Opdater" class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000;" value="Reset"></td><td width="20"><input type="submit" name="action" value="Frigør boks" onClick="return confirm('Er du sikker på du vil frigøre boksen?')"class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000"></td></tr></table>
<table border="0" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt;" width="460" cellpadding="0" cellspacing="0">
<tr><td width="70">Navn:</td><td width="90"><input type="text" name="navn" value="<%=rs1("navn")%>" class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000;"></td><td></td></tr>
<tr><td width="70">Ejer:</td><td width="90"><input type="text" name="ejer" value="<%=rs1("Ejer")%>" class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000;"></td><td>offentlig oplysninger:<input type="checkbox" name="offen" <%if rs1("visning") = true then response.write("checked")%>></td></tr>
<tr><td width="70">Alder:</td><td width="90"><input type="text" name="alder" value="<%=rs1("alder")%>" class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000;"></td><td></td></tr>
<tr><td width="70">Race:</td><td width="90"><input type="text" name="race" value="<%=rs1("race")%>" class="css" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000;"></td><td>Hest:<select name="type" readonly style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000;"><option value="Privathest" <%if rs1("hest") = "Privathest" then response.write("selected")%>>Privathest<option value="Elevhest" <%if rs1("hest") = "Elevhest" then response.write("selected")%>>Elevhest</select></td>
</tr></table>
beskrivelse: <br><textarea NAME="nyhed" wrap="virtual" cols="70" rows="6" style="background-color: #E3DFC4; color: #000000; font-family: Verdana; font-size: 8 pt; border: 1 solid #000000; scrollbar-face-color:#E3DFC4; scrollbar-shadow-color:#E3DFC4; scrollbar-highlight-color:#E3DFC4; scrollbar-3dlight-color:#E3DFC4; scrollbar-arrow-color:#E3DFC4; scrollbar-darkshadow-color:#E3DFC4; scrollbar-track-color:#E3DFC4;"}><%=rs1("beskrivelse")%></te xtarea><br><br><br><div id="divtest"><a href="java script:history.back(-1)">Tilbage</a></div></center >
min sql der opdatere:
response.buffer = true
billede=request.form("pic")
hest=request.form("type")
beskrivelse=request.form("nyhed")
offen=request.form("offen")
navn=request.form("navn")
ejer=request.form("ejer")
race=request.form("race")
alder=request.form("alder")
if offen = "on" then
visning = -1
else
visning = 0
end if
if billede = "" then
billede = "knap.gif"
end if
if fri = "" then
boksfri = 0
else
boksfri = -1
end if
sql ="update stald set "
sql = sql & "boks= '" & Request("id") & "', "
sql = sql & "navn= '" & request.form("navn") & "', "
sql = sql & "alder= '" & request.form("alder") & "', "
sql = sql & "ejer= '" & Request.form("ejer") & "', "
sql = sql & "race= '" & request.form("race") & "', "
sql = sql & "beskrivelse= '" & request.form("nyhed") & "', "
sql = sql & "hest= '" & Request.form("type") & "', "
sql = sql & "boksfri= '" & boksfri & "', "
sql = sql & "pict= '" & billede & "', "
sql = sql & "visning= '" & visning &"' WHERE id='"& request("id")&"' "
cn.execute sql
cn.close
set cn = nothing
---------------------------
Fejltype:
Microsoft JET Database Engine (0x80040E07)
Datatyperne stemmer ikke overens i kriterieudtrykket.
min access database indeholder
id - autonummering
boks - tal
navn - notat
alder - tal
ejer - notat
race - notat
beskrivelse - notat
hest - notat
boksfri - janej (jeg har prøvet at lave den tekst)
pict - notat
visning - ja/nej (jeg har prøvet at lave den tekst)
jeg har søgt på google efter nogle svar. og jeg har prøvet mig frem med at fjerne ' hvis det er tal jeg indsætter i databasen. intet har hjulpet.