Ciao a tutti. Non riesco a capire perchè mi dia questo errore...
ho una pagina con un form:
nella pagina insertprodotti ho vari campi di testo, nei quali inserisco numeri e testo. nel mio db come "tipo dati" c'è solo testo o al massimo memo. Eppure quanto tento di eseguire l'inserimento nel db, mi da questo errore..
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
Ma non ho campi data nel mio db!!
la pagina insertprodotti è questa:
<form method="POST" action="insert.asp" name="theform">
<table border="0" cellpadding="5" cellspacing="5" align="center" bgcolor="#147b3e" width="500">
<tr>
<td class="tahoma11">Codice:</td>
<td><input type="text" name="Cod" size="56" class="tahoma11"></td>
</tr>
<tr>
<td class="tahoma11">Tipo Prodotto:</td>
<td><input type="text" name="prod" size="56" class="tahoma11"></td>
</tr>
</table>
<table border="0" cellpadding="5" cellspacing="5" align="center" bgcolor="f7ea40" width="500">
<tr>
<td class="tahoma11">Descrizione:</td>
<td><input type="text" name="Desc" size="56" class="tahoma11"></td>
</tr>
<tr>
<td class="tahoma11">Id Categoria</td>
<td class="tahoma11"><select name="idCategoria" size="1" class="tahoma11">
<option value="1">1 - Telephone</option>
<option value="2">2 - Building Material</option>
<option value="3">3 - Office</option>
<option value="4">4 - Computer</option></select></td>
</tr>
<tr>
<td class="tahoma11">Pezzi x Pacco</td>
<td><input type="text" name="quantita" size="56" class="tahoma11"></td>
<td></td>
</tr>
</table>
<table border="1" cellpadding="5" cellspacing="5" align="center" bgcolor="#ed2224" width="500">
<form name="theform" method="post" action="">
<tr>
<td class="tahoma11">Qt1 <input type="text" name="qt1" size="8" class="tahoma11">Ns. Prezzo<input name="importo_1" type="text" id="importo_1" onKeyUp="if((isNaN(this.value))&&this.value.lastIn dexOf('.')==-1){alert('attenzione\n\nInserire solo numeri e il punto come virgola');this.value='';document.theform.percent_1 .value='';}else{document.theform.percent_1.value=( this.value)*125/100;}" size="8" class="tahoma11">in Birr <input name="percent_1" class="tahoma11" type="text" id="percent_1" size="8"> Prezzo Birr Finale<input type="text" name="prezzo1" size="8" class="tahoma11"></td>
</tr>
<tr>
<td class="tahoma11">Qt2 <input type="text" name="qt1" size="8" class="tahoma11">Ns. Prezzo <input name="importo_2" type="text" id="importo_2" onKeyUp="if((isNaN(this.value))&&this.value.lastIn dexOf('.')==-1){alert('attenzione\n\nInserire solo numeri e il punto come virgola');this.value='';document.theform.percent_2 .value='';}else{document.theform.percent_2.value=( this.value)*125/100;}" size="8" class="tahoma11">in Birr <input class="tahoma11" name="percent_2" type="text" id="percent_2" size="8"> Prezzo Birr Finale<input type="text" name="prezzo2" size="8" class="tahoma11"></td>
</tr>
<tr>
<td class="tahoma11">Qt3 <input type="text" name="qt1" size="8" class="tahoma11">Ns. Prezzo <input name="importo_3" type="text" id="importo_3" onKeyUp="if((isNaN(this.value))&&this.value.lastIn dexOf('.')==-1){alert('attenzione\n\nInserire solo numeri e il punto come virgola');this.value='';document.theform.percent_3 .value='';}else{document.theform.percent_3.value=( this.value)*125/100;}" size="8" class="tahoma11">in Birr <input name="percent_3" class="tahoma11" type="text" id="percent_3" size="8"> Prezzo Birr Finale<input type="text" name="prezzo3" size="8" class="tahoma11"></td>
</tr>
<tr>
<td class="tahoma11">Qt4 <input type="text" name="qt1" size="8" class="tahoma11">Ns. Prezzo <input name="importo_4" type="text" id="importo_4" onKeyUp="if((isNaN(this.value))&&this.value.lastIn dexOf('.')==-1){alert('attenzione\n\nInserire solo numeri e il punto come virgola');this.value='';document.theform.percent_4 .value='';}else{document.theform.percent_4.value=( this.value)*125/100;}" size="8" class="tahoma11">in Birr <input name="percent_4" class="tahoma11" type="text" id="percent_4" size="8"> Prezzo Birr Finale<input type="text" name="prezzo4" size="8" class="tahoma11"></td>
</tr>
<tr>
<td width="325" align="center"><center><input type="submit" value="OK" name="B1" class="tahoma11"><input type="reset" value="Reimposta" name="B2" class="tahoma11"></center></td>
</tr>
</table>
</form>
</form>
poi nella pagina seguente, cioè quella che fa l'insert ho:
<%
'APERTURA CONNESSIONE CON IL DATABASE SENZA DSN
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/catalogo.mdb")
cod = Request.Form("cod")
prod = Request.Form("prod")
Desc = Request.Form("Desc")
IdCat = Request.Form("IdCategoria")
Quant = Request.Form("quantita")
qt1 = Request.Form("qt1")
prezzo1 = Request.Form("prezzo1")
qt2 = Request.Form("qt2")
prezzo2 = Request.Form("prezzo2")
qt3 = Request.Form("qt3")
prezzo3 = Request.Form("prezzo3")
qt4 = Request.Form("qt4")
prezzo4 = Request.Form("prezzo4")
strSQL = "INSERT INTO prodotti(CodProdotto,TipoProdotto,Descrizione,IdCa tegoria,Quantita,Qt1,Prezzo1,Qt2,Prezzo2,Qt3,Prezz o3,Qt4,Prezzo4) VALUES ('"&cod&"','"&prod&"','"&Desc&"','"&IdCat&"','"&Qu ant&"','"&qt1&"','"&prezzo1&"','"&qt2&"','"&prezzo 2&"','"&qt3&"','"&prezzo3&"','"&qt4&"','"&prezzo4& "')"
objConn.Execute strSQL
objConn.Close
'Set objRS = Server.CreateObject("ADODB.Recordset")
'objRS.Open strSQL, objConn
Response.write "<table><tr><td class='tahoma11'>Ho inserito il prodotto "&prod&" con codice "&cod&" nella categoria "&IdCat&". In ogni pacco ci sono "&quant&" pezzi.
Il prezzo per ogni "&qt1&" pacchi è "&prezzo1&".
"
If qt2 <> "" then
response.write "Il prezzo per ogni "&qt2&" pacchi è "&prezzo2&".
"
else
end if
If qt3 <> "" then
response.write "Il prezzo per ogni "&qt3&" pacchi è "&prezzo3&".
"
else
end if
If qt4 <> "" then
response.write "Il prezzo per ogni "&qt4&" pacchi è "&prezzo4&"[/b].
</td></tr></table>"
else
end if
%>
help!
Fede