Salve,

mi continua ad uscire questo errore:

Tipo di errore:
ADODB.Recordset (0x800A0E79)
L'operazione non è consentita se l'oggetto è aperto.
/gestionale/ordini.asp, line 66

eppure l'oggetto non è aperto :/
cmq sia
questa è la pagina:
codice:
<%
set rs_sub = server.CreateObject("ADODB.RecordSet")
set rs_clienti = server.CreateObject("ADODB.Recordset")
set rs_ordini = server.CreateObject("ADODB.RecordSet")

if soc="" then
%>
<div align="center">
  <center>
  <table border="0" width="30%" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%" colspan="3" bgcolor="#000080"><font color="#FFFFFF">Seleziona
        la societa</font></td>
    </tr>
    <tr>
      <td width="3" rowspan="2" bgcolor="#000080">
      <SELECT name="societa" onchange="javascript:{location.href='ordini.asp?id='+this.value}">
      <%
      sql="select * from aziende order by nome_azienda"
      rs_clienti.open sql, cn_clienti,1,3
      rs_clienti.MoveFirst
      while not rs_clienti.EOF
      %>
      <OPTION value="<%=rs_clienti("id")%>"><%=rs_clienti("nome_azienda")%></OPTION>
      <%
      rs_clienti.MoveNext
      wend
      rs_clienti.Close
      cn_clienti.close
      set rs_clienti=nothing
      set cn_clienti=nothing
      %>
      </SELECT>
      </td>
      <td width="33%"></td>
      <td width="3" rowspan="2" bgcolor="#000080"></td>
    </tr>
    <tr>
      <td width="33%"></td>
    </tr>
    <tr>
      <td width="100%" colspan="3" height="3" bgcolor="#000080"></td>
    </tr>
  </table>
  </center>
</div>
<%else%>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
  <tr><font class="font">
    <td width="25%">Rif. Nostro</td>
    <td width="25%">Rif. Cliente</td>
    <td width="25%">Commerciale</td>
    <td width="25%">Totale</td>
    </font>
  </tr>
  <%
  sql ="select distinct nostro_rif from ordini where idsocieta="&soc
  rs_ordini.Open sql, cn
  if rs_ordini.EOF or rs_ordini.BOF then
  Response.Write ("<tr><td colspan=""4""><font class=""font"">Nessun ordine trovato</font></td></tr>")
  else
  rs_ordini.MoveFirst
  while not rs_ordini.EOF
  rif = rs_ordini("nostro_rif")
  rs_sub.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mapPath("gestionale.mdb")
  ssql ="SELECT * FROM commerciali INNER JOIN ordini ON commerciali.ID = ordini.idcommerciale where idsocieta="&soc
  'Response.Write sql
  'Response.end
  rs_sub.Open ssql [red]<--- riga 66[/red]
  while not rs_sub.EOF
  %>
  <tr><font class="font">
    <td width="25%"><%=rs_sub("nostro_rif")%></td>
    <td width="25%"><%=rs_sub("rif_ordine")%></td>
    <td width="25%"><%=rs_sub("commerciale")%></td>
    <td width="25%">
    <%
    prezzo		= rs_sub("prezzo_vendita")
    quantita	= rs_sub("quantita")
    totale		= prezzo * quantita
    totale1		= totate1 + totale
    Response.Write totale1
    %>
    </td>
    </font>
  </tr>
  <%
  rs_sub.MoveNext
  wend
  rs_ordini.MoveNext
  wend
  end if
  rs_ordini.Close
  rs_sub.Close
  set rs=nothing
  set rs_ordini=nothing
  cn_ordini.close
  set cn_ordini=nothing
  set cn=nothing
  end if
  %>
</table>
in alto c'è:
[comde]
<%
dim cn, rs, sql, cn_clienti, rs_clienti, rs_ordini, cn_ordini
set cn = server.CreateObject("ADODB.Connection")
cn.open = "dsn=gestionale"
set cn_ordini = server.CreateObject("ADODB.Connection")
cn_ordini.open = "dsn=gestionale"
set cn_clienti = server.CreateObject("ADODB.Connection")
cn_clienti.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mapPath("../rubrica/rubricacoretech2.mdb")

soc = Request("id")
soc1 = Request.Cookies("gest")("idsoc")
if soc = "" then
soc = soc1
elseif soc = soc1 then
soc = soc
elseif soc <> soc1 then
Response.Cookies("gest")("idsoc")=soc
end if
%>
[/code]