Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 19

Discussione: Database Access

  1. #1

    Database Access

    Ciao a tutti...
    Vi chiedo una cosa sulla velocità del database...
    Innanzitutto ho rinunciato alla conversione Access MySql,
    Ho chiesto un pò in giro e ci sono alcuni siti che hanno circa lo stesso mio numero di prodotti, ma sono molto più leggeri e quindi veloci...
    Ho provato a fare una cosa...
    nel database ecom, ho creato un'altra tabella, in relazione con quella dei prodotti, da dove prende le immagini,
    l'unica cosa mi è uscito un problemino...
    solo catalogo.asp,
    prende i dati dalla tabella prodotti,
    però deve prendere la foto dalla tabella colore,
    e non riesco mi da sempre errore.

    Ritornando un'atimo indietro, nella scheda.asp ho fatto questa modifica:

    '---Recupero le informazioni sul prodotto dal database
    SQLScheda = " SELECT * FROM Colore WHERE ID = "& QSID & " "
    Set RSScheda = Conn.Execute(SQLScheda)

    '---Assegno e stampo a video
    If Not RSScheda.EOF Then
    Goccia = RSScheda("Goccia")
    Goccia2 = RSScheda("Goccia2")
    RSScheda.Close


    Mentre nel file inc-catalogo.asp
    ho fatto :



    SQL = " SELECT * FROM Colore WHERE ID = "& QSID & " "
    Set RS = Conn.Execute(SQLScheda)
    If Not RS.EOF Then
    Goccia2 = RS("Goccia2")


    però mi esce questo errore:
    Microsoft VBScript compilation error '800a041f'

    Unexpected 'Next'

    /include/inc_catalogo.asp, line 211

    Next
    ^

    alla linea 211 c'è:
    <%
    RS.MoveNext
    Next
    Next

    Else

    Sapete darmi una mano???

    Grazie

  2. #2
    Utente di HTML.it L'avatar di diegoctn
    Registrato dal
    May 2001
    Messaggi
    2,118
    Perchè due volte next?

  3. #3
    Eh
    a dire il vero non lo so...

    L'ho notato anche io ne ho tolto uno ma l'errore rimane!

  4. #4

  5. #5
    <%
    'VERSIONE FILE 1.4.0
    %>



    <div align="center">
    <table width="500" align="center" >
    <tr bgcolor="<%=Tabella_Colore_Cella%>"> </tr>
    <tr>
    <td valign="top" align="center" bordercolor="#EDEDED" nowrap bgcolor="#dedede">
    <table style="border:1px dashed #999999" border="0" cellpadding="0"width="98%" align="center">
    <tr>
    <td align="center">
    <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" bordercolor="#CCCCCC">
    <tr bgcolor="#eeeeee">
    <td colspan="3">
    <div align="center">
    <%
    '---Dichiarazione variabili
    Dim I, Footer, RStip, Index, ArrQuery, SPrezzo, Offerta

    If (QSSCategoria <> "") Or (QSQuery <> "") Then

    ' inizio modifiche by Supermax
    ' per visualizzare il percorso in cui ci si trova nel catalogo prodotti
    Dim smSQLCat, smRSCat, smscat, smcat, smdovesei

    if QSSCategoria <>"" then
    smSQLCat = " SELECT ID, SCategoria FROM SCategorie where ID="&Cint(QSSCategoria)
    smscat=""
    Set smRScat = Conn.Execute(smSQLCat)
    If Not smRSCat.EOF Then
    smscat=smRScat("Scategoria")
    end if
    smRSCat.close
    end if

    if QSCategoria <>"" then
    smSQLCat = " SELECT * FROM Categorie where ID="&Cint(QSCategoria)
    smcat=""
    Set smRScat = Conn.Execute(smSQLCat)
    If Not smRSCat.EOF Then
    smcat=smRScat("Categoria")
    end if
    smRSCat.close
    end if


    if smcat<>"" then
    smdovesei=smdovesei&" <font size=3 color=ff6600>"&smcat&"</font>"
    end if

    response.write(smdovesei)
    ' fine modifiche by Supermax %>
    </div>
    </td>
    </tr>
    <%
    If (QSSCategoria = "") AND (QSCategoria = "") AND (QSQuery = "") Then
    Response.Redirect Request.ServerVariables("HTTP_REFERER")
    Else
    '---Stampo a video i prodotti delle categorie richieste
    Set RS = Server.CreateObject("ADODB.RecordSet")
    RS.PageSize = MaxProdottiPerPagina

    If QSQuery <> "" Then
    QSQuery = Replace(QSQuery, "'", "''")
    ArrQuery = Split(QSQuery, " ")


    SQL = " SELECT * FROM Colore WHERE ID = "& QSID & " "
    Set RS = Conn.Execute(SQLScheda)
    If Not RS.EOF Then
    Goccia2 = RS("Goccia2")

    SQL = " SELECT * FROM Prodotti WHERE "
    For i = 0 to UBound(ArrQuery, 1)
    SQL = SQL & "(Prodotto LIKE '%" & ArrQuery(i) & "%' OR PDescrizione LIKE '%" & ArrQuery(i) & "%' OR GDescrizione LIKE '%" & ArrQuery(i) & "%') AND "
    Next
    SQL = SQL & "Cancellato = False"
    RS.Open SQL, Conn, 1
    Else
    If (QSCategoria = "") Then
    SQL = " SELECT * FROM Prodotti WHERE SCategoria = "& [QSSCategoria] &" AND Categoria = 0 AND Cancellato = False "
    RS.Open SQL, Conn, 1
    End If

    If (QSCategoria <> "") Then
    SQL = " SELECT * FROM Prodotti WHERE Categoria = "& [QSCategoria] &" AND Cancellato = False"
    RS.Open SQL, Conn, 1
    End If
    End If

    If Not RS.EoF Then
    RS.MoveFirst
    RS.AbsolutePage = QSPg

    If QSPg <> 1 Then
    Footer = "" & PrimaPagina & " "
    Else
    Footer = PrimaPagina & " "
    End If

    For I = 1 To RS.PageCount
    If I = QSPg Then
    Footer = Footer & I & " "
    Else
    Footer = Footer & ""& I &" "
    End If
    Next

    If QSPg <> RS.PageCount Then
    Footer = Footer & "" & UltimaPagina & ""
    Else
    Footer = Footer & UltimaPagina
    End If

    For I = 1 To RS.PageSize
    If RS.EOF Then Exit For
    %>
    <tr bgcolor="#FFFFFF">
    <form method="get" action="prod_aggiungi.asp">
    <td rowspan="3" valign="middle" align="center" width="15%" style="BORDER-RIGHT: #ff6600 0px dashed; BORDER-BOTTOM: #ff6600 1px dashed"><img src="
    <%
    If RS("PFoto") <> "" Then
    Response.Write RS("PFoto")
    Else
    Response.Write Path_IMG & Img_NonDisponibile_P
    End If
    %>
    " width="<%=PFoto_Larghezza%>" height="<%=PFoto_Altezza%>">
    </td>
    <td width="64%" valign="top">"><%=RS("Nome")%>

    <%=Goccia2%> </td>
    <td rowspan="3" align="center" valign="bottom" width="21%" bgcolor="#FBFDA2" style="BORDER-RIGHT: #ff6600 0px dashed; BORDER-BOTTOM: #ff6600 1px dashed">
    <input type="text" name="quantita" size="2" maxlength="5" value="1">
    <input type="hidden" name="ID" value="<%=RS("ID")%>">
    <%
    If (RS("Giacenza") > 0) OR RS("GiacenzaInfinita") Then
    %>
    <input type="image" src="<%=Path_Img%>catalogo_aggiungi.gif" name="Go" value="<%=AltPulsante%>" alt="<%=AltPulsante%>" border="0">
    <%
    Else
    %>
    [img]<%=Path_Img%>catalogo_aggiungi.gif[/img]" border="0">
    <%
    End If
    %>
    </td>
    </form>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td width="64%" valign="top">
    <%
    SPrezzo = RS("SPREZZO")
    PrezzoNoIva = RS("CPREZZO")
    IvaProdotto = RS("IVA")
    CalcoloIva = PrezzoNoIva / 100 * IvaProdotto
    PrezzoIvato = PrezzoNoIva + CalcoloIva
    %>
    <%If Offerta = True Then%>
    <s> <%=SimboloValuta%>
    <%
    If SPrezzo <> "" then
    Response.Write VisualizzaPrezzo(PrezzoIvato1)
    Else
    Response.Write ""
    End If
    %>
    <%
    End IF
    %>
    </s>


    <%=SimboloValuta%> <font color="red"><%=VisualizzaPrezzo(PrezzoIvato)%></font>

    <%
    If Session("Rivenditore") = True Then
    %>
    <%=TitoloRPrezzo%>: <%=SimboloValuta%> <font color="red"><%=VisualizzaPrezzo(RS("RPrezzo"))%></font>

    <%
    End If
    %>
    </p>
    </td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td width="64%" valign="top" style="BORDER-RIGHT: #ff6600 0px dashed; BORDER-BOTTOM: #ff6600 1px dashed"><%=Disponibilita%>:
    <%
    If ImmagineGiacenza Then
    Response.Write "[img][/img]"
    Else
    If RS("GiacenzaInfinita") Then
    Response.Write TestoGiacenzaInfinita
    Else
    Response.Write RS("Giacenza")
    End If
    End If
    %>
    </td>
    </tr>
    <%
    RS.MoveNext
    Next

    Else
    %>
    <tr bgcolor="<%=Tabella_Colore_Cella%>">
    <td colspan="3" align="center" bgcolor="#FFFFFF"> <%=NoRecordTrovati%>
    </td>
    </tr>
    <%
    End If
    RS.Close
    %>
    </table>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </div>
    <div align="center">



    <%=Footer%>

    </div>

  6. #6
    non tutto... io non sto a leggerlo, sorry. posta il blocco che dà errore

  7. #7
    AAAA,
    ma te l'ho già postato!

    codice:
                    <%
    					RS.MoveNext
    				Next
    				Next 
    			Else
    %>
    In rosso la linea 211 che genera l'errore!

    Mentre quello che ho aggiunto
    che poi mi ha fatto generare l'errore è:

    codice:
    '---Stampo a video i prodotti delle categorie richieste
    			Set RS = Server.CreateObject("ADODB.RecordSet")
    			RS.PageSize = MaxProdottiPerPagina
    			
    			If QSQuery <> "" Then
    				QSQuery = Replace(QSQuery, "'", "''")
    				ArrQuery = Split(QSQuery, " ")
    
    
    				SQL = " SELECT * FROM Colore WHERE ID = "& QSID & " "
    				Set RS = Conn.Execute(SQLScheda)
    	            If Not RS.EOF Then
    	         	Goccia2 = RS("Goccia2") 
    				SQL = " SELECT * FROM Prodotti WHERE "
    				For i = 0 to UBound(ArrQuery, 1)
    					SQL = SQL & "(Prodotto LIKE '%" & ArrQuery(i) & "%' OR PDescrizione LIKE '%" & ArrQuery(i) & "%' OR GDescrizione LIKE '%" & ArrQuery(i) & "%') AND "
    				Next
    				SQL = SQL & "Cancellato = False"
    				RS.Open SQL, Conn, 1
    			Else
    				If (QSCategoria = "") Then
    					SQL = " SELECT * FROM Prodotti WHERE SCategoria = "& [QSSCategoria] &" AND Categoria = 0  AND Cancellato = False "
    					RS.Open SQL, Conn, 1
    				End If
    	
    				If (QSCategoria <> "") Then
    					SQL = " SELECT * FROM Prodotti WHERE Categoria = "& [QSCategoria] &" AND Cancellato = False"
    					RS.Open SQL, Conn, 1
    				End If
    			End If
    
    			If Not RS.EoF Then 
    				RS.MoveFirst
    				RS.AbsolutePage = QSPg
    
    				If QSPg <> 1 Then
    					Footer = "" & PrimaPagina & " "
    				Else
    					Footer = PrimaPagina & " "
    				End If
    
    				For I = 1 To RS.PageCount
    					If I = QSPg Then
    						Footer = Footer & I & " "
    					Else
    						Footer = Footer & ""& I &" "
    					End If
    				Next
    
    				If QSPg <> RS.PageCount Then
    					Footer = Footer & "" & UltimaPagina & ""
    				Else
    					Footer = Footer & UltimaPagina
    				End If
    
    				For I = 1 To RS.PageSize
    					If RS.EOF Then Exit For
    %>
    Sempre in rosso!

  8. #8
    ascolta ho seguito di nuovo il tuo consiglio,
    ho tolto un Next
    e l'errore che mi appare è questo:
    Microsoft VBScript compilation error '800a03f6'

    Expected 'End'

    /catalogo.asp, line 149

    alla linea 149 c'è:

    codice:
                          <input type="image" src="<%=Path_Img%>catalogo_aggiungi.gif" name="Go" value="<%=AltPulsante%>" alt="<%=AltPulsante%>" border="0">
                          <%
    					Else
    %>
                          [img]<%=Path_Img%>catalogo_aggiungi.gif[/img]" border="0"> 
                          <%
    					End If
    %> 
                        </td>
                      </form>
    sempre in rosso è la riga di riferimento!

  9. #9
    probabilmente l'if che hai aggiunto non è chiuso, oppure hai inframezzato una if...endif e una for...next

    del tipo

    IF a=b then
    for i=1 to 20
    end if
    next


    così da' sempre errore

  10. #10
    E sai dirmi cosa devo fare,
    perchè non ho ben capito!

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.