En fejl i scriptet.
http://www.partytube.dk/hockey/oprettur.aspJeg får denne fejl når jeg prøver at udfylde formen og trykke opret:
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
Her er koden :
<%
Mode = Request.Querystring("Mode")
%>
<%
If Mode = "add" Then
%>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("bus.mdb")
Conn.Open DSN
tur_navn = Replace( Request.Form("tur_navn"), "'", "''" )
Pris = Replace( Request.Form("Pris"), "'", "''" )
Afgangstid_agerskov = Replace( Request.Form("Afgangstid_agerskov"), "'", "''" )
Afgangstid_rodekro = Replace( Request.Form("Afgangstid_rodekro"), "'", "''" )
Afgangstid_vojens = Replace( Request.Form("Afgangstid_vojens"), "'", "''" )
afgangsdato = Replace( Request.Form("afgangsdato"), "'", "''" )
Dato = date()
If tur_navn = "" Then
Response.Write " Du skal indtaste et bynavn. Tryk tilbage i browseren og prøv igen!"
Else
sql = "Insert into Tur(tur_navn, Pris, Afgangstid_agerskov, Afgangstid_vojens, Afgangstid_rodekro, afgangsdato) values('" & tur_navn & "', '" & Pris & "', '" & Afgangstid_agerskov & "', '" & Afgangstid_vojens & "', '" & Afgangstid_rodekro & "', '" & afgangsdato & "')"
Conn.execute(sql)
Conn.Close
Set Conn = Nothing
Response.redirect "index.asp"
End If
else
end if
%>
<form method="POST" action="oprettur.asp?Mode=add">
<b>
<font face="Arial Narrow">Opret bustur:</font></b><font face="Tahoma" size="2"><br>
</font><table border="0" width="100%" height="26">
<tr>
<td width="14%" height="7"><font face="Arial Narrow" size="2">Hvilken by?</font></td>
<td width="85%" height="7"><font face="Tahoma">
<input type="text" name="tur_navn" size="35" style="border-style: solid; border-width: 1"></font></td>
</td>
</tr>
<tr>
<td width="14%" height="3"><font face="Arial Narrow" size="2">Afgangsdato:</font></td>
<td width="85%" height="3"><font face="Tahoma">
<input type="text" name="afgangsdato" size="10" style="border-style: solid; border-width: 1"></font></td>
</tr>
<tr>
<td width="14%" height="3"><font face="Arial Narrow" size="2">Afgangstid
fra Rødekro</font></td>
<td width="85%" height="3"><font face="Tahoma">
<input type="text" name="Afgangstid_rodekro" size="10" style="border-style: solid; border-width: 1"></font></td>
</tr>
<tr>
<td width="14%" height="3"><font face="Arial Narrow" size="2">Afgangstid
fra Agerskov</font></td>
<td width="85%" height="3"><font face="Tahoma">
<input type="text" name="Afgangstid_agerskov" size="10" style="border-style: solid; border-width: 1"></font></td>
</tr>
<tr>
<td width="14%" height="3"><font face="Arial Narrow" size="2">Afgangstid
fra Vojens</font></td>
<td width="85%" height="3"><font face="Tahoma">
<input type="text" name="Afgangstid_vojens" size="10" style="border-style: solid; border-width: 1"></font></td>
</tr>
<tr>
<td width="14%" height="3"><font face="Arial Narrow" size="2">Pris:</font></td>
<td width="85%" height="3"><font face="Tahoma">
<input type="text" name="Pris" size="35" style="border-style: solid; border-width: 1"></font></td>
</tr>
</table>
<p>
<font face="Tahoma">
<input type="submit" value="Opret" name="B1" style="border-style: solid; border-width: 1"></font></p>
</form>
Hvad er det jeg har overset ?