my.ASPItalia.com
ASP.NET
|
HTML5
|
LINQ e Entity Framework
|
Silverlight
|
Windows Phone
|
.NET Framework
|
Windows 8
|
Libro WP7
|
Libro HTML5
|
Corso HTML5
Iscriviti
Login
Newsletter
Home
Articoli
Script
Notizie
FORUM
Blogs
Media
Tutorials
Corsi
Libri
Eventi
Tags
Tutti i forum
Ricerca
FAQ
Fai una domanda
Navigazione tra recordset ... non so come fare!!!!!!!
in
Classic ASP
>
ASP - base
Ultimo messaggio
demo76
il 26 maggio 2006 alle 00:06
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"> </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"> </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"> </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"> </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">
<<Pag. Precedente
</div></td>
<td width="190" class="px10"><div align="center">
Pag. Successiva >>
</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
%>
Rispondi
Quoting
vitosulla
il 26 maggio 2006 alle 08:37
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/
Rispondi
Quoting
Salto rapido
Ultimi messaggi
Tutti i forum
Ricerca
Utenti online
ASP.NET
ASP.NET 2.0
ASP.NET 3.5
ASP.NET 4.0
.NET Framework
Silverlight
Windows Phone
Windows Presentation Foundation e WinForms
Windows Communication e Workflow
ASP - avanzato
ASP - base
SQL Server e MySQL
E-commerce
Hosting
Altri linguaggi e tecnologie
Windows Server, IIS & Security
Libri
OT
Commenti: blogs e notizie
Eventi
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.
Community
Effettua il login!
Hai dimenticato la password?
UTENTI ONLINE
In primo piano
Annunciate le versioni ufficiali di Visual Studio 11
Rilasciato Visual Studio 11 Beta: scopri tutte le novità!
Windows 8 Consumer Preview: segui con noi la diretta
I più letti di oggi
Mobile Web con HTML5 e jQuery Mobile (Community Days 2012)
Annunciate le versioni ufficiali di Visual Studio 11
Internet Explorer 10 Platform Preview 1 (IE10 PP1)
Web Camp - HTML5 per il web di oggi (Community Days 2012)
Tutorial ASP.NET
Media
Metro Style App per Windows 8 con HTML e Javascript
Applicazioni Metro con XAML: cosa cambia per lo sviluppatore .NET con Windows 8
Tutti i media
In evidenza
Dal 29 febbraio arriva WinRTItalia.com: tutto sullo sviluppo per Windows 8 e Metro
Metro Style App per Windows 8 con HTML e Javascript
Aggiungere un handler globale per le chiamate AJAX di ASP.NET MVC
Annunciate le versioni ufficiali di Visual Studio 11
Applicazioni Metro con XAML: cosa cambia per lo sviluppatore .NET con Windows 8
Utilizzare AppFabric con Windows Azure
Windows 8: introduzione allo sviluppo
Spostare il mouse ed eseguire il click programmaticamente in Silverlight 5.0
MISC
I nostri autori
Collabora con noi!
Media Kit - Pubblicità sul nostro network