Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 18
  1. #1
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400

    Unterminated string constant

    Perchè questo codice continua a restituire errore:
    Error Type:
    Microsoft VBScript compilation (0x800A0409)
    Unterminated string constant
    codice:
    Set objRs = Server.CreateObject("ADODB.Recordset")
           strSQL = "Select * from Tab where ... "
           objRs.Open strSql, cn, 3, 3
           If Not objRs.EOF Then
           eseguito = objRs("eseguito")
                      
           Response.Write "<TR><TD ALIGN='CENTER' CLASS='MARGIN' WIDTH=70>"&I&"" _
           &"</TD><TD WIDTH=150 CLASS='MARGIN'><a href='pagina?uoat="&aMessageMOD4(I)&"&imp="&aMessageMOD5(I)&"&odm="&odm&"'>
    
       if eseguito = false then
           
           [img]./img/img1.gif[/img]</a></TD></TR>"
           
       else
           
           [img]./img/img2.gif[/img]</a></TD></TR>"
        
        end if
        end if
    :master:

  2. #2

  3. #3
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Originariamente inviato da optime
    quale riga?
    Grazie Optime, sulla riga rossa restituisce:
    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement
    codice:
    Set objRs = Server.CreateObject("ADODB.Recordset")
           strSQL = "Select * from Tab where ... "
    
           objRs.Open strSql, cn, 3, 3
           If Not objRs.EOF Then
           eseguito = objRs("eseguito")
           
           Response.Write "<TR><TD ALIGN='CENTER' CLASS='MARGIN' WIDTH=70>"&I&"" _
           &"</TD><TD WIDTH='90' CLASS='MARGIN'>" &aMessageMOD4(I) &"</TD><TD WIDTH='90' CLASS='MARGIN'>" &aMessageMOD3(I) &"</TD><TD WIDTH='90' CLASS='MARGIN'>" &aMessageMOD2(I) &"</TD><TD WIDTH='90' CLASS='MARGIN'>" &aMessageMOD5(I) &"</TD><TD WIDTH='500' CLASS='MARGIN'>" &aMessages(I) _
           &"</TD><TD WIDTH='300'  CLASS='MARGIN'>" &aMessageContentSplit(I)&"</TD><TD WIDTH='300' CLASS='MARGIN'>" &aMessageMOD6(I)&"</TD><TD WIDTH=150 CLASS='MARGIN'><a href='pagina.asp?iduoat="&iduoat&"&code=1&time=" &I &"" &"&date=" _
           &dtDate &"'>[img]./images/modify.gif[/img]</a>" &"<a href='pagina.asp?iduoat="&iduoat&"&code=2&time=" &I &"" &"&date=" &dtDate _
           &"'>[img]./images/delete.gif[/img]</a>" &"<a href='pagina.asp?uoat="&aMessageMOD4(I)&"&imp="&aMessageMOD5(I)&"&odm="&odm _
           
       if eseguito = false then
          &"'>[img]./img/img1.gif[/img]</a>"</TD></TR>    
    
    else
          &"'>[img]./img/img2.gif[/img]</a>"</TD></TR>
       end if
    end if

  4. #4
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Spiego meglio il problema e posto il codice non modificato.

    Ho una tabella con 10 righe e 9 colonne; l'ultima delle colonne contiene 3 icone: la prima serve per cancellare il record, la seconda per modificare il record, la terza per rendere true il campo si/no di quel determinato record.

    Fin qui tutto funziona; il problema è che vorrei che una volta che quel record è passato a condizione true tramite la terza icona, la stessa icona fosse sostituita da un'altra icona.

    Non ci riesco, ecco il code completo originale:
    set objconn = server.createobject("ADODB.connection")
    strconn = "Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("mdb-database/db.mdb")
    objconn.open strconn

    iduoat = request.querystring("iduoat")
    utente = (request.cookies("innovatel.it_accesso")("nome"))

    if utente <> 22 and utente <> 53 and utente <> 60 then
    strSQL = "Select * from Message where id_uoat = "&iduoat&" and DueDate = #" &dtDate &"# order by DueDate"
    else
    strSQL = "Select * from Message where DueDate = #" &dtDate &"# order by DueDate"
    end if
    set objREC = objConn.Execute(strSQL)

    Redim aMessages(10)
    Redim aMessageContent(10)
    Redim aMessageContentSplit(10)
    Redim aMessageMod(10)
    Redim aMessageMod2(10)
    Redim aMessageMod3(10)
    Redim aMessageMod4(10)
    Redim aMessageMod5(10)
    Redim aMessageMod6(10)

    For I = 0 to 10
    aMessages(I) = ""
    aMessageContent(I) = ""
    aMessageContentSplit(I) = ""
    aMessageMod(I) = ""
    aMessageMod2(I) = ""
    aMessageMod3(I) = ""
    aMessageMod4(I) = ""
    aMessageMod5(I) = ""
    aMessageMod6(I) = ""

    Next

    Do While NOT objREC.EOF

    aMessages(CInt(Left(objREC("DueTime"),2))) = objREC("Subject")
    aMessageMOD(CInt(Left(objREC("DueTime"),2))) = objREC("LastModified")
    aMessageContent(CInt(Left(objREC("DueTime"),2))) = objREC("Content")
    aMessageContentSplit(CInt(Left(objREC("DueTime"),2 ))) = objREC("ContentSplit")
    aMessageMOD2(CInt(Left(objREC("DueTime"),2))) = objREC("dueDate2")
    aMessageMOD3(CInt(Left(objREC("DueTime"),2))) = objREC("dueDate")
    aMessageMOD4(CInt(Left(objREC("DueTime"),2))) = objREC("uoat")
    aMessageMOD5(CInt(Left(objREC("DueTime"),2))) = objREC("imp")
    aMessageMOD6(CInt(Left(objREC("DueTime"),2))) = objREC("odm")

    objREC.MoveNext
    Loop

    objrec.close
    set objrec = nothing

    objconn.close
    set objconn = nothing

    For I = 1 to 10

    If I = 10 then
    strAdder = 0
    else
    strAdder = I + 1
    end if

    Response.Write "<TR><TD ALIGN='CENTER' CLASS='MARGIN' WIDTH=70>"&I&"" _
    &"</TD><TD WIDTH='90' CLASS='MARGIN'>" &aMessageMOD4(I) &"</TD><TD WIDTH='90' CLASS='MARGIN'>" &aMessageMOD3(I) &"</TD><TD WIDTH='90' CLASS='MARGIN'> " &aMessageMOD2(I) &"</TD><TD WIDTH='90' CLASS='MARGIN'> " &aMessageMOD5(I) &"</TD><TD WIDTH='500' CLASS='MARGIN'> " &aMessages(I) _
    &"</TD><TD WIDTH='300' CLASS='MARGIN'> " &aMessageContentSplit(I)&"</TD><TD WIDTH='300' CLASS='MARGIN'> " &aMessageMOD6(I)&"</TD><TD WIDTH=150 CLASS='MARGIN'><a href='pagina.asp?iduoat="&iduoat&"&code=1&time=" &I &"" &"&date=" _
    &dtDate &"'>[img]./images/modify.gif[/img]</a> " &"<a href='pagina.asp?iduoat="&iduoat&"&code=2&time=" &I &"" &"&date=" &dtDate _
    &"'>[img]./images/delete.gif[/img]</a> " &"[img]./img/ppfeill.gif[/img]</TD></TR>"

    Next

  5. #5
    tu stai facendo una cosa del tipo

    str="ciao "
    IF a = 1 then
    & "bello"
    ELSE
    & "brutto"
    END IF

    ma non si puote!


    str="ciao "
    IF a = 1 then
    str = str & "bello"
    ELSE
    str = str & "brutto"
    END IF

  6. #6
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Non capisco cosa vuoi dirmi con questo...

    cos'è nel mio codice "str"?

  7. #7
    i due codici che hai postato sono alquanto diversi... qual è quello che dà errore? e dov'è l'errore? e qual è l'errore?

  8. #8
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Originariamente inviato da optime
    i due codici che hai postato sono alquanto diversi... qual è quello che dà errore? e dov'è l'errore? e qual è l'errore?
    Ho eseguito altri tentativi... ciò che vorrei è che una volta che quel record è passato a condizione "true" tramite la terza icona, la stessa icona fosse sostituita da un'altra icona ed ho scritto così:
    codice:
    if utente <> 22 and utente <> 53 and utente <> 60 then
         strSQL = "Select * from Message where id_uoat = "&iduoat&" and DueDate = #" &dtDate  &"#  order by DueDate"
      else    
         strSQL = "Select * from Message where DueDate = #" &dtDate  &"#  order by DueDate"
    end if
    
    Set objREC = Server.CreateObject("ADODB.Recordset")
    objREC.Open strSql, cn, 3, 3
    If Not objREC.EOF Then
    eseguita = objREC("eseguita")
    
    ...
    
    if eseguita = false then
          Response.write eseguita
    else
          Response.write "pippo"
    end if
    end if
    Il problema è che anche se nel DB ho dei records con il campo "eseguita" true lo script restituisce sempre "false" e non capisco perchè...


  9. #9
    fatti stampare il valore di "eseguita"

  10. #10
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    OK.

    La cosa che mi manda in "bestia" è che sulla riga rossa viene stampato regolarmente il valore di "eseguita" quindi se è true o false; mentre nelle righe verdi stampa sempre "ciccio"...
    codice:
    if utente <> 22 and utente <> 53 and utente <> 60 then
         strSQL = "Select * from Message where id_uoat = "&iduoat&" and DueDate = #" &dtDate  &"#  order by DueDate"
      else    
         strSQL = "Select * from Message where DueDate = #" &dtDate  &"#  order by DueDate"
    end if
    
    Set objREC = Server.CreateObject("ADODB.Recordset")
    objREC.Open strSql, objConn, 3, 3
    
    
    Do While NOT objREC.EOF 
     
            eseguita = objREC("eseguita")
            response.write eseguita &"
    "          
            
            objREC.MoveNext
            Loop    
         
           objrec.close
           set objrec = nothing
           objconn.close
           set objconn = nothing 
    
    
    For I = 1 to 10 
          
        If I = 10 then 
             strAdder = 0
            else
             strAdder = I + 1
           end if 
                 
           Response.Write "..."
     
       if eseguita = False then
          Response.write "ciccio"
       else
          Response.write "pippo"
       end if    
      
          Next 
             end if

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.