Devi fare una query ed un recordset indipendenti dal resto.
Specifici per la combo.
Devi fare una query ed un recordset indipendenti dal resto.
Specifici per la combo.
Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!
<td width="">
<%
strSQL = "SELECT * FROM categorie ORDER BY cat DESC"
Set objRS = Server.CreateObject("ADODB.Recordset")
%>
Categorie:
<select name="cat">
<%
if not objrs.eof then
do while not objrs.eof
%>
- <option value="<%=objrs("cat")%>"><%=objrs("cat")%></option>
<%
objrs.movenext
loop
else
- <option value="-1">Nessuna categoria disponibile</option>
end if
%>
</select>
</td>
![]()
Ars longa...vita brevis.
Cosa sognifica non va? :master:
Ti dà errore?
Se si, quale?
Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!
con il codice che segue la combo select è vuota e subito dopo niente (come se lo script fosse interrotto subito dopo la combo select...)
<td width="">
<%
strSQL = "SELECT * FROM categorie ORDER BY cat DESC"
Set objRS = Server.CreateObject("ADODB.Recordset")
%>
Categorie:
<select name="cat">
<%
if not objrs.eof then
do while not objrs.eof
%>
- <option value="<%=objrs("cat")%>"><%=objrs("cat")%></option>
<%
objrs.movenext
loop
else
%>
- <option value="-1">Nessuna categoria disponibile</option>
<%
end if
%>
</select>
</td>
Ars longa...vita brevis.
Prova la query della combo:
direttamente sul DB, per vedere se ti restituisce informazioni.codice:strSQL = "SELECT * FROM categorie ORDER BY cat DESC"
Per quanto riguarda il resto della pagina, non è che per caso hai utilizzato lo stesso oggetto recordset per le due query?
Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!
Leggi l'ultimo mio post a pagina 1.
Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!
ho letto...
se faccio la connessione al database in un'altra pagina mi restituisce il contenuto...
nella pagina in questione no...
Ars longa...vita brevis.
Posta tutto il codice della pagina (combo compresa).
Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!
<html>
<head>
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="background-attachment: fixed; background-image: url('images/bkg.jpg');">
<TABLE WIDTH="560" CELLPADDING="0" CELLSPACING="0" BORDER="0" align="center">
<TD>
<%
'determino il nome di questo file anche se rinominato...
Dim path, thisfile
path = Request.ServerVariables("PATH_INFO")
path = mid(path,instrrev(path,"/") + 1)
' ... e lo chiamo thisfile
thisfile = path
If request.QueryString ("cerca") = "" Then
iPageSize = 4 'NUMERO RECORD PER PAGINA
else
iPageSize = 4 'NUMERO RECORD PER PAGINA
end if
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
dim cerca
cerca = request.QueryString ("cerca")
If cerca = "" Then
strSQL = "SELECT * FROM immagini Where id>0 ORDER BY id DESC"
else
strSQL = "SELECT * FROM immagini Where titolo like '%" & cerca & "%' OR descrizione like '%" & cerca & "%' ORDER BY id DESC"
end if
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.PageSize = iPageSize
objRS.CacheSize = iPageSize
objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
reccount = objRS.recordcount
iPageCount = objRS.PageCount
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
%>
<table width="560" align="center">
<tr>
<td width="" colspan="2" bgcolor="white">
[img]<%=logo %>[/img]
</td>
</tr>
<tr>
<td align="left" width="50%" bgcolor="white">
<%
''If lang = "eng" Then
''Response.Write "[img]images/snatt.jpg[/img]"
''else
''Response.Write "[img]images/snatt.jpg[/img]"
''end if
%>
<%
If lang = "" Then
%>
» 1° Pagina
<%
else
%>
» 1° Page
<%
end if
%>
[img]images/admin.gif[/img]" border="0"/>
</td>
<td width="">
<%
strSQL = "SELECT * FROM categorie ORDER BY cat DESC"
Set objRS = Server.CreateObject("ADODB.Recordset")
%>
Categorie:
<select name="cat">
<%
if not objrs.eof then
do while not objrs.eof
%>
- <option value="<%=objrs("cat")%>"><%=objrs("cat")%></option>
<%
objrs.movenext
loop
else
%>
- <option value="-1">Nessuna categoria disponibile</option>
<%
end if
%>
</select>
</td>
<td width="50%" align="right" bgcolor="white">
<form method="get" action="index.asp">
<% If lang <> "" then %>
<input type="hidden" name="lang" value="<%=lang %>">
<% end If %>
<input type="text" name="cerca" value="<%=langCerca %>" onclick="value=''">
<input type="image" src="cerca.gif" value="Cerca" alt="<%=altCerca %>">
</form>
</td>
</tr>
</table>
<%
If iPageCount = 0 Then
Response.Write "<table width='555' cellpadding='4' align='center' border='1'><tr><td><font face='verdana' size='2' color='#000000'>Il database non contiene i dati richiesti</td></tr></table>"
Else
objRS.AbsolutePage = iPageCurrent
iRecordsShown = 0
%>
<table cellpadding="0" cellspacing="0" border="0" width="555" align="center">
<tr>
<td bgcolor="#cccccc">
<table cellpadding="4" cellspacing="0" border="1" width="100%">
<tr height="22">
<td bgcolor="#77B71A" WIDTH="90"><font face="verdana" size="2" color="white"><%=colonna1 %></font></td>
<td bgcolor="#77B71A" WIDTH="130"><font face="verdana" size="2" color="white"><%=colonna2 %></font></td>
<td bgcolor="#77B71A" WIDTH="" align="left"><font face="verdana" size="2" color="white"><%=colonna3 %></font></td>
<td bgcolor="#77B71A" WIDTH="12" align="center"><font face="verdana" size="2" color="white"></font></td>
</tr>
<%
'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
cont=1
Do While iRecordsShown < iPageSize And Not objRS.EOF
Dim Rig, bg
Rig = Rig + 1
If Rig Mod 2 = 0 then
bg = "#E4E4E4"
Else
bg = "#ccccff"
End if
If objRS("fileOpera1") <> "" Then
Response.Write "<tr bgcolor = " & bg & "><td><font color='#000000' face='Verdana' size='1'>[img]./public/opere/" & objRS("fileOpera1") & "[/img]</font></td>"
else
Response.Write "<tr bgcolor = " & bg & "><td><font color='#000000' face='Verdana' size='1'>[img]images/noimage.gif[/img]</font></td>"
end if
Response.Write "<td><font color='#000000' face='Verdana' size='1'>" & objRS("titolo") & "
" & pezzi & ": " & objRS("qt") & "</font></td>"
Response.Write "<td align='left'>"
Response.Write "<font color='#000000' face='Verdana' size='1'>" & mag & ": " & objRS("magazzino") & "</font>
"
Response.Write "<font color='#000000' face='Verdana' size='1'>" & cor & ": " & objRS("corridoio") & "</font>
"
Response.Write "<font color='#000000' face='Verdana' size='1'>" & col & ": " & objRS("colonna") & "</font>
"
Response.Write "<font color='#000000' face='Verdana' size='1'>" & pia & ": " & objRS("piano") & "</font>
"
Response.Write "</td>"
Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>"
Response.Write ""
Response.Write "</font></td>"
Cont = Cont + 1
'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
iRecordsShown = iRecordsShown + 1
objRS.MoveNext
Loop
'PULIZIA DEGLI OGGETTI ADO
objRS.Close
Set objRS = Nothing
%>
</table>
</td>
</tr>
<tr>
<td width="" colspan="4" bgcolor="#77B71A">
[img]images/shim.gif[/img]
</td>
</tr>
</table>
<%End if%>
<%
objConn.Close
Set objConn = Nothing
%>
</TD>
</TR>
</TABLE>
</body>
</html>
Ars longa...vita brevis.