Ma il codice è quello che ti ho postato prima, dove poi mi hai chiesto solo la parte dell'errore!
Ma il codice è quello che ti ho postato prima, dove poi mi hai chiesto solo la parte dell'errore!
in quella parte di codice manca un next e 2 if che sicuramente in tutto il programma ci saranno,Originariamente inviato da tatiana_s
Ma il codice è quello che ti ho postato prima, dove poi mi hai chiesto solo la parte dell'errore!
se mi posti il tutto con le ultime modifiche magari troviamo l'errore =)
codice:<% 'VERSIONE FILE 1.5.Ver.3 Moicans & Snake %> <table style="border:1px dashed #999999" border="0" cellPadding="0"width="95%" cellspacing="0" align="center"> <tr> <td bgcolor="#D6D6D6"> <% '---Dichiarazione variabili Dim SQL, RS, I, Footer, RStip, Index, ArrQuery,Precedente, Successiva,prima,ultima If (QSSCategoria <> "") Or (QSQuery <> "") Then%> <%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 SCategoria <>"" then smSQLCat = " SELECT * FROM S_Categorie where id="&Cint(SCategoria) smca="" Set smRScat = Conn.Execute(smSQLCat) If Not smRSCat.EOF Then smca=smRScat("S_Categoria") end if smRSCat.close end if smdovesei="[img]&Path_Img&[/img]"%> <%if smscat<>"" then smdovesei=smdovesei&""&smscat&"" end if if smcat<>"" then smdovesei=smdovesei&"[img]&Path_Img&[/img]<font color=#336699>"&smcat&"</font>" end if if smca<>"" then smdovesei=smdovesei&"[img]&Path_Img&[/img]<font color=#336699>"&smcat&"</font>" end if if QSQuery2<>"" then smdovesei=smdovesei&" [img]&Path_Img&[/img]"&QSQuery2&"" end if response.write(smdovesei) %> <% End If %> </td> </tr> </table> <tr> <td> <% If (QSSCategoria = "") AND (QSCategoria = "") AND (QSQuery = "") AND (SCategoria = "") 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 'RS.PageSize = 10 If QSQuery2 <> "" Then QSQuery2 = Replace(QSQuery2, "'", "''") ArrQuery = Split(QSQuery2, " ") SQL = " SELECT * FROM Prodotti WHERE " For i = 0 to UBound(ArrQuery, 1) SQL = SQL & "(categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto 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 Cancellato = False ORDER BY ID DESC " RS.Open SQL, Conn, 1 End If If (QSCategoria <> "") Then SQL = " SELECT * FROM Prodotti WHERE Categoria = "& [QSCategoria] &" AND Cancellato = False ORDER BY ID DESC" RS.Open SQL, Conn, 1 End If If (SCategoria <> "") AND (QSCategoria <> "") AND (SCategoria <> "")Then SQL = "SELECT * FROM Prodotti WHERE S_Categoria = "& [SCategoria] &" AND Cancellato = False ORDER BY ID DESC " end if End If If Not RS.EoF Then RS.MoveFirst RS.AbsolutePage = QSPg Prima = "<img border=0 src=interfaccia/prima.jpg align=center>" Precedente = "<img border=0 src=interfaccia/sinistra.png align=center>" ultima = "<img border=0 src=interfaccia/ultima.jpg align=center>" Successiva = "<img border=0 src=interfaccia/destra.png align=center>" If QSPg <> 1 Then Footer = "" & Prima & " " Footer = Footer & "" & Precedente & " " Else Footer = " " Footer = Footer & " " End If For I = 1 To RS.PageCount If I = QSPg Then Footer = Footer & I & " " Else Footer = Footer & "<font size = 4 color = red ><font size = 2 >"& I &"</font> " End If Next If QSPg <> RS.PageCount Then Footer = Footer & "" & Successiva & " " Footer = Footer & "" & ultima & "" Else Footer = Footer & " " End If %> <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0"> <% cont=0 For I = 1 To RS.PageSize cont=cont+1 if cont=1 then %> <tr bordercolor="#FF6600" bgcolor="#ececec"> <% end if If RS.EOF Then Exit For if Tabella_Colore_Cella="#FFFFFF" then Tabella_Colore_Cella="#DEDEDE" else Tabella_Colore_Cella="#FFFFFF" end if %> <td height="25" style="border:1px dashed #999999" > <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0"> <tr bordercolor="#FF6600" bgcolor="#ececec"> <td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td> </tr> </table> </td> <%if cont=4 then%> </tr> <% cont=0 end if %> <%RS.MoveNext Next%> <%Else %> <%=NoRecordTrovati%> <% End If End If RS.Close %> <%if cont<4 then for a=cont to 3 %> <%end if%> </table> <p align="center"> <%=Footer%> </p>
<%if cont<4 then
for a=cont to 3
%>
<%end if%>
a cosa ti serve? (parte finale)
questo
<td height="25" style="border:1px dashed #999999" >
<table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
<tr bordercolor="#FF6600" bgcolor="#ececec">
<td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td>
</tr>
</table>
</td>
puoi trasformarlo in
<td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td>
in pratica diventerebbe
provacodice:<% 'VERSIONE FILE 1.5.Ver.3 Moicans & Snake %> <table style="border:1px dashed #999999" border="0" cellPadding="0"width="95%" cellspacing="0" align="center"> <tr> <td bgcolor="#D6D6D6"> <% '---Dichiarazione variabili Dim SQL, RS, I, Footer, RStip, Index, ArrQuery,Precedente, Successiva,prima,ultima If (QSSCategoria <> "") Or (QSQuery <> "") Then%> <%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 SCategoria <>"" then smSQLCat = " SELECT * FROM S_Categorie where id="&Cint(SCategoria) smca="" Set smRScat = Conn.Execute(smSQLCat) If Not smRSCat.EOF Then smca=smRScat("S_Categoria") end if smRSCat.close end if smdovesei="[img]&Path_Img&[/img]"%> <%if smscat<>"" then smdovesei=smdovesei&" "&smscat&"" end if if smcat<>"" then smdovesei=smdovesei&" [img]&Path_Img&[/img]<font color=#336699>"&smcat&"</font>" end if if smca<>"" then smdovesei=smdovesei&" [img]&Path_Img&[/img]<font color=#336699>"&smcat&"</font>" end if if QSQuery2<>"" then smdovesei=smdovesei&" [img]&Path_Img&[/img]"&QSQuery2&"" end if response.write(smdovesei) %> <% End If %> </td> </tr> </table> <tr> <td> <% If (QSSCategoria = "") AND (QSCategoria = "") AND (QSQuery = "") AND (SCategoria = "") 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 'RS.PageSize = 10 If QSQuery2 <> "" Then QSQuery2 = Replace(QSQuery2, "'", "''") ArrQuery = Split(QSQuery2, " ") SQL = " SELECT * FROM Prodotti WHERE " For i = 0 to UBound(ArrQuery, 1) SQL = SQL & "(categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto 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 Cancellato = False ORDER BY ID DESC " RS.Open SQL, Conn, 1 End If If (QSCategoria <> "") Then SQL = " SELECT * FROM Prodotti WHERE Categoria = "& [QSCategoria] &" AND Cancellato = False ORDER BY ID DESC" RS.Open SQL, Conn, 1 End If If (SCategoria <> "") AND (QSCategoria <> "") AND (SCategoria <> "")Then SQL = "SELECT * FROM Prodotti WHERE S_Categoria = "& [SCategoria] &" AND Cancellato = False ORDER BY ID DESC " end if End If If Not RS.EoF Then RS.MoveFirst RS.AbsolutePage = QSPg Prima = "<img border=0 src=interfaccia/prima.jpg align=center>" Precedente = "<img border=0 src=interfaccia/sinistra.png align=center>" ultima = "<img border=0 src=interfaccia/ultima.jpg align=center>" Successiva = "<img border=0 src=interfaccia/destra.png align=center>" If QSPg <> 1 Then Footer = "" & Prima & " " Footer = Footer & "" & Precedente & " " Else Footer = " " Footer = Footer & " " End If For I = 1 To RS.PageCount If I = QSPg Then Footer = Footer & I & " " Else Footer = Footer & "<font size = 4 color = red ><font size = 2 >"& I &"</font> " End If Next If QSPg <> RS.PageCount Then Footer = Footer & "" & Successiva & " " Footer = Footer & "" & ultima & "" Else Footer = Footer & " " End If %> <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0"> <% cont=0 For I = 1 To RS.PageSize cont=cont+1 if cont=1 then %> <tr bordercolor="#FF6600" bgcolor="#ececec"> <% end if If RS.EOF Then Exit For if Tabella_Colore_Cella="#FFFFFF" then Tabella_Colore_Cella="#DEDEDE" else Tabella_Colore_Cella="#FFFFFF" end if %> <td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td> <%if cont=4 then%> </tr> <% cont=0 end if %> <%RS.MoveNext Next%> <%Else %> <%=NoRecordTrovati%> <% End If End If RS.Close %> </table> <p align="center"> <%=Footer%> </p>
OK.
La tabella l'avevo trasformata, ma ti ho postato il codice com'era all'inizio...
Togliendo l'ultima parte sotto.
FUNZIONA ALLA GRANDE.
GRAZIE 1000
![]()