10 messaggi dal 19 marzo 2006
Raga scusate la mega massa di codice ma sono arrivato anche di cervello oggi...
Spiego il problema:
Vorrei fare in modo che le parole scritte in grassetto in questo codice mi permetta di navigare all'interno dei recordset.
Il problema è che se lo faccio con dreamweaver avendo due recordset filtrati per due diversi campi (prodCat e prodMarc) i pulsanti nn mi funzionano.
Se non lo faccio con dreamweaver nn so come dirgli di passare le info giuste.
In che modo posso fare?

HELP ME PLEASE

E SCUSATE ANCORA PER LA MEGA PAGINA DI CODICE MA SONO PROPRIO ALLA FRUTTA E RISCHIO DI TOGLIERE QUALCOSA CHE MAGARI VI SERVE PER AIUTARMI.

GRAZIE A CHIUNQUE MI POTRA' DARE UNA MANO





<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/db_data.asp" -->
<%
Dim RS_marche
Dim RS_marche_numRows

Set RS_marche = Server.CreateObject("ADODB.Recordset")
RS_marche.ActiveConnection = MM_db_data_STRING
RS_marche.Source = "SELECT * FROM marca ORDER BY marca ASC"
RS_marche.CursorType = 0
RS_marche.CursorLocation = 2
RS_marche.LockType = 1
RS_marche.Open()

RS_marche_numRows = 0
%>
<%
Dim RS_categorie
Dim RS_categorie_numRows

Set RS_categorie = Server.CreateObject("ADODB.Recordset")
RS_categorie.ActiveConnection = MM_db_data_STRING
RS_categorie.Source = "SELECT * FROM categoria ORDER BY categoria ASC"
RS_categorie.CursorType = 0
RS_categorie.CursorLocation = 2
RS_categorie.LockType = 1
RS_categorie.Open()

RS_categorie_numRows = 0
%>
<%
Dim Rs_prodMarc__MMColParam
Rs_prodMarc__MMColParam = "1"
If (Request.form("marche") <> "") Then
Rs_prodMarc__MMColParam = Request.form("marche")
End If
%>
<%
Dim Rs_prodMarc
Dim Rs_prodMarc_numRows

Set Rs_prodMarc = Server.CreateObject("ADODB.Recordset")
Rs_prodMarc.ActiveConnection = MM_db_data_STRING
Rs_prodMarc.Source = "SELECT * FROM prodotti WHERE marca = '" + Replace(Rs_prodMarc__MMColParam, "'", "''") + "' ORDER BY nomeprodotto ASC"
Rs_prodMarc.CursorType = 0
Rs_prodMarc.CursorLocation = 2
Rs_prodMarc.LockType = 1
Rs_prodMarc.Open()

Rs_prodMarc_numRows = 0
%>
<%
Dim RS_prodCat__MMColParam
RS_prodCat__MMColParam = "1"
If (Request.form("categorie") <> "") Then
RS_prodCat__MMColParam = Request.form("categorie")
End If
%>
<%
Dim RS_prodCat
Dim RS_prodCat_numRows

Set RS_prodCat = Server.CreateObject("ADODB.Recordset")
RS_prodCat.ActiveConnection = MM_db_data_STRING
RS_prodCat.Source = "SELECT * FROM prodotti WHERE categoria = '" + Replace(RS_prodCat__MMColParam, "'", "''") + "' ORDER BY nomeprodotto ASC"
RS_prodCat.CursorType = 0
RS_prodCat.CursorLocation = 2
RS_prodCat.LockType = 1
RS_prodCat.Open()

RS_prodCat_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
Rs_prodMarc_numRows = Rs_prodMarc_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = 10
Repeat2__index = 0
RS_prodCat_numRows = RS_prodCat_numRows + Repeat2__numRows
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (RS_prodCat_total = -1) Then

' count the total records by iterating through the recordset
RS_prodCat_total=0
While (Not RS_prodCat.EOF)
RS_prodCat_total = RS_prodCat_total + 1
RS_prodCat.MoveNext
Wend

' reset the cursor to the beginning
If (RS_prodCat.CursorType > 0) Then
RS_prodCat.MoveFirst
Else
RS_prodCat.Requery
End If

' set the number of rows displayed on this page
If (RS_prodCat_numRows < 0 Or RS_prodCat_numRows > RS_prodCat_total) Then
RS_prodCat_numRows = RS_prodCat_total
End If

' set the first and last displayed record
RS_prodCat_first = 1
RS_prodCat_last = RS_prodCat_first + RS_prodCat_numRows - 1

If (RS_prodCat_first > RS_prodCat_total) Then
RS_prodCat_first = RS_prodCat_total
End If
If (RS_prodCat_last > RS_prodCat_total) Then
RS_prodCat_last = RS_prodCat_total
End If

End If
%>
...................codice html..................
<tr>
<td width="5" valign="top" background="img/lat_blu/barra_lat_blu_r3_c1.jpg">&nbsp;</td>
<td valign="top"><table width="163" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="163"><br>
<form action="ricerca_result.asp" method="get" name="cerca" id="cerca">
<table width="145" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<input name="cerca" type="text" class="campitesto" id="cerca">
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="image" name="imageField" src="img/cerca_puls/cerca_puls.jpg">
</div></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td class="rosso12"><div align="center">Marche</div></td>
</tr>
<tr>
<td width="163"><form name="form2" method="post" action="cerca_result.asp">
<table width="145" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<select name="marche" class="campitesto" id="marche">
<%
While (NOT RS_marche.EOF)
%>
<option value="<%=(RS_marche.Fields.Item("marca").Value)%>"><%=(RS_marche.Fields.Item("marca").Value)%></option>
<%
RS_marche.MoveNext()
Wend
If (RS_marche.CursorType > 0) Then
RS_marche.MoveFirst
Else
RS_marche.Requery
End If
%>
</select>
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="image" name="imageField2" src="img/cerca_puls/cerca_puls.jpg">
</div></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td class="rosso12"><div align="center">Categorie</div></td>
</tr>
<tr>
<td width="163"><form name="form1" method="post" action="cerca_result.asp">
<table width="145" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<select name="categorie" class="campitesto" id="categorie">
<%
While (NOT RS_categorie.EOF)
%>
<option value="<%=(RS_categorie.Fields.Item("categoria").Value)%>"><%=(RS_categorie.Fields.Item("categoria").Value)%></option>
<%
RS_categorie.MoveNext()
Wend
If (RS_categorie.CursorType > 0) Then
RS_categorie.MoveFirst
Else
RS_categorie.Requery
End If
%>
</select>
</div></td>
</tr>
<tr>
<td><div align="center">
<input type="image" name="imageField3" src="img/cerca_puls/cerca_puls.jpg">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td width="10" valign="top" background="img/lat_blu/barra_lat_blu_r3_c3.jpg">&nbsp;</td>
</tr>
<tr>
<td height="15" colspan="3" valign="top"><img src="img/lat_blu/barra_lat_blu_r5_c1.jpg" width="178" height="15"></td>
</tr>
</table>
</div></td>
</tr>
.................... codice html...............
<tr>
<td height="30" valign="top"><%
While ((Repeat1__numRows <> 0) AND (NOT Rs_prodMarc.EOF))
%>
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" colspan="2" background="img/barra_prod.jpg"><table width="560" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="382"><table width="370" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="standard"><%=(Rs_prodMarc.Fields.Item("nomeprodotto").Value)%></td>
</tr>
</table></td>
<td width="90"><div align="center" class="rosso12"><%=(Rs_prodMarc.Fields.Item("prezzonoiva").Value)%></div></td>
<td width="90" class="standard"><div align="center"><strong><%=(Rs_prodMarc.Fields.Item("prezzoiva").Value)%></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="382"><table width="370" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="px10">Dettagli</td>
</tr>
</table></td>
<td width="180">&nbsp;</td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Rs_prodMarc.MoveNext()
Wend
%></td>
</tr>
<tr>
<td valign="top"><%
While ((Repeat2__numRows <> 0) AND (NOT RS_prodCat.EOF))
%>
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" colspan="2" background="img/barra_prod.jpg"><table width="562" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="383"><table width="370" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="standard"><%=(RS_prodCat.Fields.Item("nomeprodotto").Value)%></td>
</tr>
</table></td>
<td width="90"><div align="center" class="rosso12"><%=(RS_prodCat.Fields.Item("prezzonoiva").Value)%></div></td>
<td width="90" class="standard"><div align="center"><strong><%=(RS_prodCat.Fields.Item("prezzoiva").Value)%></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="382"><table width="370" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="px10">Dettagli</td>
</tr>
</table></td>
<td width="180">&nbsp;</td>
</tr>
</table>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
RS_prodCat.MoveNext()
Wend
%></td>
</tr>
<tr>
<td><table width="380" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="190"><div align="center" class="px10"> &lt;&lt;Pag. Precedente </div></td>
<td width="190" class="px10"><div align="center"> Pag. Successiva &gt;&gt; </div></td>
</tr>
<tr>
<td class="px10"><div align="center"></div></td>
<td class="px10"><div align="center"></div></td>
</tr>
</table></td>
</tr>


</table></td>


...............codice html...............
</html>
<%
RS_marche.Close()
Set RS_marche = Nothing
%>
<%
RS_categorie.Close()
Set RS_categorie = Nothing
%>
<%
Rs_prodMarc.Close()
Set Rs_prodMarc = Nothing
%>
<%
RS_prodCat.Close()
Set RS_prodCat = Nothing
%>
593 messaggi dal 09 ottobre 2002
www.dotnetside.org
Se ti leggi il post "Paginazione" di qualche riga sotto il tuo, troverai un link di rimando ad una spiegazione pratica (che potrai facilmente adattare alla tua necessità) sull'utilizzo della paginazione di un resultset.

Pochi post. Anzi, quasi quasi spengo
http://www.dotnetside.org/

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.