Pagina 2 di 3 primaprima 1 2 3 ultimoultimo
Visualizzazione dei risultati da 11 a 20 su 25
  1. #11
    così come hai postato la riga 85 posta anche quelle precedenti! ...
    così vediamo di capirci qualcosa in più!

  2. #12
    ECCO TUTTO IL FILE

    codice:
    <% Option Explicit %>
    <% Response.Buffer = True %>
    <%
    	If Not Session("user") And Not Session("admin") Then
    		Response.Redirect("userError.htm")
    	Else
    %>
    
    <%
    '		********************************************************************
    '		INSERIMENTO NELLE VARIABILI DEI PARAMETRI DELLA TABELLA IMPOSTAZIONI
    '		********************************************************************
    
    		Dim objRso, strSql, strFromAddress, strBccAddress, strObjectOthEmail, strOthChiusura, bolError, intCnt
    		Set objRso = Server.CreateObject("ADODB.Recordset")
    		strSql = "SELECT strFromAddress, strBccAddress, strObjectOthEmail, strOthChiusura FROM tblImpostazioni"
    		objRso.Open strSql, objCon, adOpenkeyset, adLockReadOnly, adCmdText
    		strFromAddress = objRso("strFromAddress")
    		strBccAddress = objRso("strBccAddress")
    		strObjectOthEmail = objRso("strObjectOthEmail")
    		strOthChiusura = objRso("strOthChiusura")
    		objRso.Close
    %>
    <% 
    Response.Expires = -1500 
    Response.Expiresabsolute = Now() - 1 
    Response.AddHeader "pragma","no-cache" 
    Response.AddHeader "cache-control","private" 
    Response.CacheControl = "no-cache" 
    %> 
    <html>
    <head>
    <title>Modifiche eseguite</title>
    <link rel="stylesheet" type="text/css" href="../stile/stile.css">
    </head>
    <script language=javascript>
    <!--
    
    function ferme() {
    fenetre=this.window
    fenetre.close()
    }
    //-->
    </SCRIPT>
    <body vlink="#0000FF" bgcolor="#003466">
    <%
    '		***************************************************************************************
    '		INSERIMENTO NELLE VARIABILI DEI CAMPI MODULO E CREAZIONE DELLA STRINGA SQL PER L'UPDATE
    '		***************************************************************************************
    
    		Dim strFieldName, varFieldValue, strUpdateValues, chrWc
    		strSql = "SELECT strFieldName, strFieldDescription, chrWc FROM tblTableFields WHERE intPriority <> 0 " & _
    		"AND intPriority <> 91 AND intPriority <> 94 AND intPriority <> 95 AND intPriority <> 96 AND intPriority <> 97 " & _
    		"AND intPriority <> 98 AND intPriority <> 99 AND intPriority <> 90"
    		objRso.Open strSql, objCon, adOpenKeyset, adLockReadOnly, adCmdText
    		
    		Do While Not objRso.EOF
    			strFieldName = objRso("strFieldName")
    			chrWc = objRso("chrWc")
    			varFieldValue = Server.HTMLEncode(Trim(Replace(Request.Form(strFieldName),"'","`")))
    			strUpdateValues = strUpdateValues & strFieldName & " = " & chrWc & varFieldValue & chrWc
    			objRso.Movenext
    			If Not objRso.EOF Then strUpdateValues = strUpdateValues & ", "
    		Loop
    		objRso.Close
    
    		strSql = "UPDATE tblUtenti SET " & strUpdateValues & " WHERE strSessione = '" & Session("id") & "'"
    
    '		**************************************************
    '		CREAZIONE OGGETTO COMMAND E SCRITTURA NEL DATABASE
    '		**************************************************
    
    		Dim objCmd, intNrOfRecords
    		Set objCmd = Server.CreateObject("ADODB.Command")
    		objCmd.ActiveConnection = objCon
    		objCmd.CommandText = strSql
    		objCmd.CommandType = adCmdText
    		objCmd.Execute intNrOfRecords
    		Set objCmd = Nothing
    
    		If intNrOfRecords = 1 Then
    		
    			Dim strEmail, strEmailType, strUserid, strPassword
    			strSql = "SELECT strEmail, strEmailType, strUserid, strPassword FROM tblUtenti WHERE strSessione = '" & Session("id") & "'"
    			objRso.Open strSql, objCon, adOpenKeyset, adLockReadOnly, adCmdText
    			
    			If objRso.Recordcount = 1 Then
    		
    				strEmail = objRso("strEmail")
    				strEmailType = objRso("strEmailType")
    				strUSerid = objRso("strUserid")
    				strPassword = objRso("strPassword")
    
    				Dim strMsg
    
    				If strEmailType = "html" Then
    
    					strMsg = "<HTML>" & vbCrLf
    					strMsg = strMsg & "<HEAD><TITLE>Modifica dati utente</TITLE></HEAD>" & vbCrLf
    					strMsg = strMsg & "<BODY BGCOLOR=""#FFFFFF"">" & vbCrLf
    					strMsg = strMsg & "<FONT FACE=""Tahoma"" SIZE=""2"" COLOR=""#000000"">
    
    Il tuo profilo è stato modificato.</P>" & vbCrLf
    					strMsg = strMsg & "
    
    Per sicurezza comunichiamo gli attuali dati di accesso.</P>" & vbCrLf
    					strMsg = strMsg & "
    
    " & strOthChiusura & "</P>" & vbCrLf
    					strMsg = strMsg & "
    
    User-Id: " & strUserid & "
    Password: " & strPassword & "</P>" & vbCrLf
    					strMsg = strMsg & "</BODY>" & vbCrLf
    					strMsg = strMsg & "</HTML>" & vbCrLf
    
    				Else
    
    					strMsg = "Il vostro profilo è stato modificato." & vbCrLf & vbCrLf
    					strMsg = strMsg & "Per sicurezza comunichiamo gli attuali dati di accesso." & vbCrLf & vbCrLf
    					strMsg = strMsg & strOthChiusura & vbCrLf & vbCrLf
    					strMsg = strMsg & "User-id: " & strUserid & vbCrLf & "Password: " & strPassword & vbCrLf & vbCrLf
    
    				End If
    		
    '				********************************************
    '				SPEDIZIONE E-MAIL PER CONFERMA MODIFICA DATI
    '				********************************************
    
    				Dim objNewMail, CdoBodyFormatHTML, CdoMailFormatHTML, CdoBodyFormatTESTO, CdoMailFormatTESTO
    				CdoBodyFormatHTML = 0
    				CdoMailFormatHTML = 0
    				CdoBodyFormatTESTO = 1
    				CdoMailFormatTESTO = 1
    
    				Set objNewMail = CreateObject("CDONTS.NewMail")
    
    				objNewMail.From = strFromAddress
    				objNewMail.To = strEmail
    				objNewMail.Bcc = strBccAddress
    				objNewMail.Importance = 2
    				objNewMail.Subject = strObjectOthEmail
    
    				If strEmailType = "html" Then
    					objNewMail.BodyFormat = CdoBodyFormatHTML
    					objNewMail.MailFormat = CdoMailFormatHTML
    				Else
    					objNewMail.BodyFormat = CdoBodyFormatTESTO
    					objNewMail.MailFormat = CdoMailFormatTESTO
    					Call ConvertToPlainText(strMsg)
    				End If
    
    				objNewMail.Body = strMsg
    
    				objNewMail.Send
    				set objNewMail = Nothing
    		
    				Response.Write "<font face=""verdana, arial"" size=""2"" color=""#FFFFFF"">Procedura eseguita correttamente.
    "
    				Response.Write "Una E-mail è stata inviata all'indirizzo " & strEmail & ".
    "
    			Else
    				Response.Write "<font face=""verdana, arial"" size=""2"" color=""#FFFFFF"">Problemi nella rilettura dei dati dal database.
    "
    				Response.Write "Non è stato possibile spedire la e-mail di conferma.
    "
    				Response.Write "Vi preghiamo di ricontrollare i vostri dati ed eventualmente di riprovare.</font>
    "
    			End If
    
    			objRso.Close
    			Set objRso = Nothing
    		Else
    			Response.Write "<font face=""verdana, arial"" size=""2"" color=""#FFFFFF"">Problemi nella scrittura dei dati nel database.
    "
    			Response.Write "Non è stato possibile effettuare l'operazione di modifica.
    "
    			Response.Write "Vi preghiamo di riprovare.</font>
    "
    		End If
    %>
    
    
    
    <a href="UserLogin.asp"><font color="#FFFFFF">Torna
    indietro</font></a><font color="#FFFFFF"> - </font>
    <a href="" onclick="window.close()"><font color="#FFFF00">Chiudi la
    finestra</font></a></p>
    </body>
    </html>
    
    <%
    	End If
    
    '	***************************************
    '	SUB ROUTINE CONVERSIONE DA HTML A TESTO
    '	***************************************
    
    	Sub ConvertToPlainText(frase)
    		frase = Replace(frase, "&lt;", "<")
    		frase = Replace(frase, "&gt;", ">")
    		frase = Replace(frase, "&amp;", "&")
    		frase = Replace(frase, "&quot;", chr(34))
    		frase = Replace(frase, "€", chr(128))
    		frase = Replace(frase, "‚", chr(130))
    		frase = Replace(frase, "ƒ", chr(131))
    		frase = Replace(frase, "„", chr(132))
    		frase = Replace(frase, "…", chr(133))
    		frase = Replace(frase, "†", chr(134))
    		frase = Replace(frase, "‡", chr(135))
    		frase = Replace(frase, "ˆ", chr(136))
    		frase = Replace(frase, "‰", chr(137))
    		frase = Replace(frase, "Š", chr(138))
    		frase = Replace(frase, "‹", chr(139))
    		frase = Replace(frase, "Œ", chr(140))
    		frase = Replace(frase, "Ž", chr(142))
    		frase = Replace(frase, "‘", chr(145))
    		frase = Replace(frase, "’", chr(146))
    		frase = Replace(frase, "“", chr(147))
    		frase = Replace(frase, "”", chr(148))
    		frase = Replace(frase, "•", chr(149))
    		frase = Replace(frase, "–", chr(150))
    		frase = Replace(frase, "—", chr(151))
    		frase = Replace(frase, "˜", chr(152))
    		frase = Replace(frase, "™", chr(153))
    		frase = Replace(frase, "š", chr(154))
    		frase = Replace(frase, "›", chr(155))
    		frase = Replace(frase, "œ", chr(156))
    		frase = Replace(frase, "ž", chr(158))
    		frase = Replace(frase, "Ÿ", chr(159))
    
    		For intCnt = 160 to 255
    			frase = Replace(frase, "&#" & intCnt & ";", chr(intCnt))		
    		Next
    	End Sub
    %>

  3. #13
    inserisci response.write strSql


    dopo la linea
    strSql = "UPDATE tblUtenti SET " & strUpdateValues & " WHERE strSessione = '" & Session("id") & "'"

    e riesegui la pagina, poi posta ciò che viene fuori ...

  4. #14
    codice:
    		strSql = "UPDATE tblUtenti SET " & strUpdateValues & " WHERE strSessione = '" & Session("id") & "'"
    response.write strSql
    Così? Se ho messo giusto non cambia nulla...

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

    ODBC driver does not support the requested properties.

    /login/pages/userModifyData.asp, line 85

  5. #15
    elimina le prime due righe del file ...

  6. #16
    Ho riprovato.

    Allora, aggiungendo la tua stringa viene fuori un altro errore. Eccolo qui:
    codice:
    UPDATE tblUtenti SET strNome = 'NOMEUTENTE', strCognome = 'COGNOMEUTENTE', strCitta = 'CITTAUTENTE', strProvincia = 'PROVINCIAUTENTE', strPassword = 'PASSWORDUTENTE', strEmailType = 'html', Stato = 'STATOUTENTE' WHERE strSessione = '88555455221390810102003142925' 
    Microsoft OLE DB Provider for ODBC Drivers error '80040e21' 
    
    ODBC driver does not support the requested properties. 
    
    /login/pages/userModifyData.asp, line 86
    Togliendo le prime due righe l'errore resta quello di prima

  7. #17
    si, ma serviva per far stampare a video la stringa sql per la modifica dei dati, che tra l'altro mi sembra scritta in maniera corretta ...

  8. #18
    Ma come fai a fare un aggiornamento usando un cursore read-only?
    E' nato www.lombardiamotori.it

    www.universocase.it: il primo portale italiano di annunci immobiliari gratuiti e autogestiti!

  9. #19
    da quanto ho letto sul codice l'aggiornamento lo fa con il Command ...
    anch'io pensavo fosse per il cursore, per il lock ....

  10. #20
    Ho risolto rimettendo il file originale.


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 © 2026 vBulletin Solutions, Inc. All rights reserved.