Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 33
  1. #1
    Utente di HTML.it L'avatar di marix76
    Registrato dal
    May 2007
    Messaggi
    125

    errore : Microsoft OLE DB Provider for ODBC......

    salve a tutti. ho bisogno di aiuto non riesco a risolvere questo errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
    [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    /Offerte/off_user_add.asp, line 183


    database access+asp

    codice:
    		'Stringa SQLdi inserimento
    				SQL = "INSERT INTO [utenti](User, Passw, sitolink, old_id, regione, nome_struttura, provincia, localita, indirizzo, numero, email, isadm) VALUES ('"&user&"', '"&password&"', '"&sitolink&"', '"&oldid&"', '"&regione&"', '"&nome_struttura&"', '"&provincia&"', '"&localita&"' , '"&indirizzo&"', '"&numtel&"', '"&eemail&"', 0)"
    				Conn.Execute(SQL)
    				Conn.Close
    ecco line 183:
    codice:
    	Conn.Execute(SQL)
    chi mi può aiutare?
    grazie in anticipo

  2. #2
    Set RS = Conn.Execute(SQL)

    fulvio

  3. #3
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Si direbbe che qualche campo nella tabella non sia di tipo stringa....

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  4. #4
    Utente di HTML.it L'avatar di marix76
    Registrato dal
    May 2007
    Messaggi
    125
    ciao Fulvio58 ho cambiato come hai detto tu ma ho avuto lo stesso errore.
    Vi invio tutto il codice:aiutooooooooo

    codice:
    <%
    	'Controlla se l'utente è loggato, in caso negativo lo rimanda a news_login.asp
    	If Session("Off_Logged") <> 1 Then
    		Response.Redirect("login.asp")
    	End If
    	
    	If Session("Off_IsAdmin") <> 1  Then
    	%>	<script type="text/javascript">
    		window.alert("Non hai il permesso per accedere a questa sezione.");
    		history.back(1)
    	
    	</script><%
    	End If
    	Function CheckIsEmail(strEmailAddress)
    
    		Dim regEx, retVal
    		Set regEx = New RegExp
    		regEx.Pattern ="^(([^<>()[\]\\.,;:\s@""]+(\.[^<>()[\]\\.,;:\s@""]+)*)|("".+""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.+[a-zA-Z]{2,}))$"
    		regEx.IgnoreCase = true
    		blnReturnValue = regEx.Test(strEmailAddress)
    		CheckIsEmail = blnReturnValue
    	End Function
    %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head >
        <title>Bimbinvacanza.it - Offerte Speciali - Inserimento nuovo Utente</title>
        
        <script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">
        tinyMCE.init({
        	theme : "advanced",
            mode : "exact",
            elements: "Insert_news",
            /*plugins : "fullpage",*/
            theme_advanced_buttons3_add : "forecolor"
        });
    	</script>
    </head>
    <style>
        body 
        {
        	background-color:#d7e7ff;/*background-color:#93b4dd;*/
    		/*background-color: #3e84e1;*/
        	margin: 0px 20px 20px 0px;border:0px;
        	text-align:left;
        	font-family: sans-serif;
        	font-size:12px;
        	
        }
        /*h1
        {
        	font: italic 20px sans-serif;
        	font-style: oblique;
        	text-align: center;
        	color: ##00337a;
        	
        }*/
        .logo
        {
        	margin-left:120px;
        	width:374px;
        	height:132px;
        	background-image: url(img/offerte_man_celeste.gif);
        	background-repeat:no-repeat;
        	
        }
        .a
        {
        	border:solid 1px #000000;
        	margin-right:5px;
            float:right;
        }
        .maskform
        {
        	border:solid 1px #dd2200;
        	margin-left:20px;
        	width:500px;
        	height:auto;
        	padding:10px;
    		background-color:#ffAA44;;
        	/*background-color:#93b4dd;*/
        	color:White;
        	font-weight:bold;
        }
        button
        {
        	background: none;
        	margin:0px;border:0px;
        	padding:0px;
        }
        .modificanews
        {
        	background-image: url(images/modifica_news.jpg);
        	background-repeat: no-repeat;
        	margin-top:8px;
        	width:116px;
        	height:37px;
        }
    </style>
    <body>
        <div class="logo"></div></br>
    	
            <%
    			
    			if Request.Form("user_user") = "" then
    			%>
    		<form id="form2" method="post" action="off_user_add.asp">
    			<span style="margin-left:20px;font-size:18px;color:#00337a;font-weight:bold">Inserisci nuovo utente</span>
    
    
    			<div class="maskform">
    				<table cellspacing="10px" >
    					<tr><td>Username:</td><td><input type="text" name="user_user" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="20"> </input></td></tr>
    					<tr><td>Email:</td><td><input type="text" name="user_email" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="100"> </input></td></tr>
    					<tr><td>Password:</td><td><input type="password" name="user_password" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="12"> </input></td></tr>
    					<tr><td colspan="2"></td></tr>
    					<tr><td>Nome della Struttura:</td><td><input type="text" name="user_nomestruttura" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="100"> </input></td></tr>
    					<tr><td>Regione:</td><td><input type="text" name="user_regione" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:90px" MaxLength="25"> </input></td></tr>
    					<tr><td>Provincia:</td><td><input type="text" name="user_provincia" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:20px" MaxLength="2"> </input></td></tr>
    					<tr><td>Link Sito Struttura:</td><td><input type="text" name="user_sitolink" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="100"> </input></td><td style="font-size:9px;color:red;">Senza il prefisso http://</td></tr>
    					<tr><td colspan="2"></td></tr>
    					<tr><td>Localita':</td><td><input type="text" name="user_localita" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="100"> </input></td></tr>
    					<tr><td>Indirizzo:</td><td><input type="text" name="user_indirizzo" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:200px" MaxLength="100"> </input></td></tr>
    					<tr><td>Numero Telefonico:</td><td><input type="text" name="user_numtel" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:150px" MaxLength="30"> </input></td></tr>
    					<tr><td colspan="2"></td></tr>
    					<tr><td>Vecchio ID:</td><td><input type="text" name="user_oldid" style="border: solid 1px #dd2200;font-family:Sans-Serif;width:90px" MaxLength="9"> </input></td></tr>
    					
    					<tr>
    						<td align="right"><input type="submit" value="Inserisci" /> <input type="button" value="Annulla" onclick="window.close()" /> </td>
    					</tr>
    				</table>
    			</div>
    		</form>
    		
    		<%Else
    			check = 1 'controllo per la validità degli input
    			if Request.Form("user_password") = "" then
    			%> <span style="margin-left:20px;font-size:18px;color:red;font-weight:bold">Errore, inserire una password. 
     Torna indietro.</span><%
    			check = 0
    			End If
    			
    			'Valido l'email
    			if Request.Form("user_email") = "" then
    			%> <span style="margin-left:20px;font-size:18px;color:red;font-weight:bold">Errore, inserire un email valida. 
     Torna indietro.</span><%
    			check = 0
    			End If
    			
    			if Request.Form("user_nomestruttura") = "" then
    			%> <span style="margin-left:20px;font-size:18px;color:red;font-weight:bold">Errore, inserire un nome per la struttura associata. 
     Torna indietro.</span><%
    			check = 0
    			End If
    			
    			if Request.Form("user_regione") = "" then
    			%> <span style="margin-left:20px;font-size:18px;color:red;font-weight:bold">Errore, inserire una regione valida. 
     Torna indietro.</span><%
    			check = 0
    			End If
    			
    			if Request.Form("user_provincia") = "" then
    			%> <span style="margin-left:20px;font-size:18px;color:red;font-weight:bold">Errore, inserire una provincia valida. 
     Torna indietro.</span><%
    			check = 0
    			End If
    			
    			
    			if check = 1 then
    				user = webtodb(Request.Form("user_user")) ' Salvo i valori filtrati
    				nome_struttura = webtodb(Request.Form("user_nomestruttura"))
    				regione = webtodb(Request.Form("user_regione"))
    			    provincia  = webtodb(Request.Form("user_provincia"))
    				localita = webtodb(Request.Form("user_localita"))
    				indirizzo = webtodb(Request.Form("user_indirizzo"))
    				numtel= webtodb(Request.Form("user_numtel"))
    				eemail = webtodb(Request.Form("user_email"))
    				password = md5(Request.Form("user_password"))
    				sitolink = webtodb(Request.Form("user_sitolink"))
    				oldid = webtodb(Request.Form("user_oldid"))
    				'connessione al DB
    				%><%
    				%><%
    				'Stringa SQLdi inserimento
    				SQL = "INSERT INTO [utenti](User, Passw, sitolink, old_id, regione, nome_struttura, provincia, localita, indirizzo, numero, email, isadm) VALUES ('"&user&"', '"&password&"', '"&sitolink&"', '"&oldid&"', '"&regione&"', '"&nome_struttura&"', '"&provincia&"', '"&localita&"' , '"&indirizzo&"', '"&numtel&"', '"&eemail&"', 0)"
    				Conn.Execute(SQL)
    				Conn.Close
    				%><span style="margin-left:20px;font-size:18px;color:green;font-weight:bold">Utente inserito. 
     Chiudi.</span><%
    			End If
    		End If
    		%>
    	</body>
    </html>

  5. #5
    Originariamente inviato da fulviolo58
    Set RS = Conn.Execute(SQL)

    fulvio
    Deve solo eseguire uno statement sul database, non c'è motivo di creare un recordset.

    Originariamente inviato da br1
    Si direbbe che qualche campo nella tabella non sia di tipo stringa....

    ciao
    Come dicono br1 e l'engine del database c'è un mismatch tra il formato di uno o più campi inseriti ed il parametro passato. La butto lì: old_id è davvero stringa?
    xxx

  6. #6
    ----------------------------------------------------
    impariamo a fare un po' di debug

    *subito* dopo la composizione della stringa SQL metti

    Response.Write "maGGica SQL...: " & sql
    Response.Flush

    poi posta quello che viene a video
    ----------------------------------------------------

  7. #7
    Utente di HTML.it L'avatar di marix76
    Registrato dal
    May 2007
    Messaggi
    125
    optime l'errore è sempre questo:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

    [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

    /Offerte/off_user_add.asp, line 183


    ho inseirito :
    Response.Write "maGGica SQL...: " & sql
    Response.Flush

    subito dopo:
    Conn.Execute(SQL)

    Response.Write "maGGica SQL...: " & sql
    Response.Flush
    Conn.Close

    dove sbaglio?

  8. #8
    Utente di HTML.it L'avatar di marix76
    Registrato dal
    May 2007
    Messaggi
    125
    attenzione:
    ho eliminato completamente old_id è riesco ad inserire i dati in maniera corretta.
    Ma ho un problema il dato inserito in id_old è fondamentale perchè richiamato in altre pagine.... devo riprovare l'errore comunque è li in odl_id


  9. #9
    ma se non posti quello che viene fuori...

  10. #10
    Utente di HTML.it L'avatar di marix76
    Registrato dal
    May 2007
    Messaggi
    125
    per optime
    ho inserito quanto mi hai detto ed ecco cosa viene visualizzato:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

    [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

    /Offerte/off_user_add.asp, line 183

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.