Visualizzazione dei risultati da 1 a 4 su 4

Discussione: dove sbaglio?

  1. #1
    Utente bannato
    Registrato dal
    Dec 2004
    Messaggi
    15

    dove sbaglio?

    codice:
      Dim oRS, oConn, strSQL, adoCmd
    
     Set oRS = Server.CreateObject("ADODB.Recordset")
     Set oConn = Server.CreateObject("ADODB.Connection")
     set adoCmd = Server.CreateObject("ADODB.Command")
    
    
     oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/mdb-database/users.mdb")
     oConn.Open
    
     oRS.Open "SELECT * FROM Users", oConn, 2, 3
     oRS.Find "Email = '" & UCase(Request.QueryString("varRegEmail")) & "'"
     
     If oRS.EOF Then
    	strSQL = "INSERT INTO Clienti (Nome, Cognome)"
            strSQL = strSQL & " values " & "('Raffael', 'Besty')"
    	adoCmd.CommandText = strSQL
        adoCmd.CommandType = adCmdText
        adoCmd.ActiveConnection = adoConn
        ' Execute the SQL on the Command object
        adoCmd.Execute
    
    	'creo il cookie
    	if(NOT Request.Cookies("Ku").HasKeys)then
    		Response.Cookies("Ku")("Nome") = Request.QueryString("varRegNome")
    		Response.Cookies("Ku").Expires = Date() + 256	
    	end if
    
     	Response.Write "varEsitoRegUser=REGISTRAZIONE+COMPLETATA"
    	
     Else
    	Response.Write "varEsitoRegUser=EMAIL+ESISTENTE+RIPROVA"
     End If
     
     
     
     oRS.Close
     Set adoCmd = Nothing
     Set oRS = Nothing
     oConn.Close
     Set oConn = Nothing

  2. #2
    Utente di HTML.it L'avatar di 99eros9
    Registrato dal
    Jan 2003
    Messaggi
    2,637
    posta il tipo di errore.
    Tala är silver men tiga är guld!
    Pubblica il tuo curriculum
    Segnala il tuo sito
    Ancl

  3. #3
    Utente bannato
    Registrato dal
    Dec 2004
    Messaggi
    15
    IMPOSSIBILE VISUALIZZARE LA PAGINA

    se elimino le righe:
    adoCmd.CommandType = adCmdText
    adoCmd.ActiveConnection = adoConn
    ' Execute the SQL on the Command object
    adoCmd.Execute

    la pagina viene caricata correttamente, ma ovviamente l'inserimento del recor nel database non avviene.
    Cosa sbaglio in queste righe?

  4. #4
    Utente bannato
    Registrato dal
    Dec 2004
    Messaggi
    15
    stranamente adesso funziona

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.