Visualizzazione dei risultati da 1 a 3 su 3

Discussione: for...next

  1. #1

    for...next

    Ciao a tutti,
    ho realizzato un piccolo sistema commerciale in asp con l'aiuto di Dreamweaver.
    Ho una pagina grazie.asp che manda attraverso l'email il nominativo del cliente con gli articoli
    ordinati presi dal carrello.
    Il codice è il seguente:
    ---------------------------------------
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>


    <%
    ' UltraCart 3
    ' Copyright (c) 2002 ~ 2004 Ottivacs Design All Rights Reserved.
    ' http://www.ottivacsdesign.com
    UC_xmlPath = Server.MapPath("CartInc/CartDefinition.xml")
    Set UltraCart = UltraCartVB("UltraCart", UC_xmlPath)
    UltraCart_i = 0
    %>

    <%
    Dim RsClienti
    Dim RsClienti_numRows

    Set RsClienti = Server.CreateObject("ADODB.Recordset")
    RsClienti.ActiveConnection = MM_cnnSWDTutorial3_STRING
    RsClienti.Source = "SELECT * FROM clienti"
    RsClienti.CursorType = 0
    RsClienti.CursorLocation = 2
    RsClienti.LockType = 1
    RsClienti.Open()

    RsClienti_numRows = 0
    %>
    <!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>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>

    <%
    Dim objCDO
    Set objCDO = Server.CreateObject("CDONTS.NewMail")
    objCDO.From = "mail@mail.it" ' Mittente - indirizzo del negozio
    objCDO.To = RsClienti("Email") ' Destinatario - indirizzo del cliente
    objCDO.BCC = "mail@mail.it" ' Copia Carbone nascosta - indirizzo del negozio,
    objCDO.Subject = "Ordine di acquisto"'oggetto
    objCDO.Body = "L'ordine di acquisto" & VbCrLf &_
    "eseguito da: " & RsClienti("Nome") & " " & RsClienti("Cognome") & VbCrLf &_
    %>
    <%
    For UltraCart_i=0 To UltraCart.GetItemCount()-1

    (UltraCart.GetColumnValue("Name",UltraCart_i))& VbCrLf &_
    (UltraCart.GetColumnValue("Quantity",UltraCart_i)) & VbCrLf &_
    (UltraCart.GetColumnValue("Price",UltraCart_i))& VbCrLf &_
    (UltraCart.Subtotal)
    response.Write "----------------------------------------------------------"

    Next
    %>
    <%
    objCDO.Send() 'send mail
    Set objCDO = Nothing 'chiude e libera le risorse
    %>

    <%response.write "Grazie per aver scelto www.nomesito.it. Il tuo ordine è stato correttamente inoltrato. Torna presto a trovarci!"%>

    <%
    RsClienti.Close()
    Set RsClienti = Nothing
    %>
    </html>

    ---------------------------------------
    Questo codice funziona, solo che quando inserisco il ciclo for..next mi esce scritto così:

    Microsoft VBScript compilation error '800a03ea'

    Syntax error

    /tutorialshopping2/grazie.asp, line 45

    For UltraCart_i=0 To UltraCart.GetItemCount()-1

    Cosa succede?
    Grazie in anticipo

  2. #2
    ho provato a inserire l'oggetto asperror come descritto nella guida completa di HTML ma mi riporta l'errore di sintassi su on error.

    <%
    on error resume next
    For UltraCart_i=0 To UltraCart.GetItemCount()-1
    if err.number>0 then
    response.write "Numero d'errore---> " & err.number & "
    "
    response.Write "Descrizione----> " & err.description & "
    "
    end if
    %>

    Aiuto!!!

  3. #3
    aiuuuuuuuuuuuuuuuuutoooooooooooooooooooooo

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.