se può servire volentieri...è un ciclo ma enorme
codice:
<%
Set objview = Server.CreateObject( "ADODB.Connection" )
objview.Open "Provider=SQLOLEDB;Server=ss02;Database=Simonetto;Uid=sa;Pwd=sa;"
set objRS =Server.CreateObject("ADODB.Recordset")
objRS.Open SQL, objview
do while not objRS.EOF
%>
<tr bgcolor="LemonChiffon" onmouseover="this.bgColor='#a4b7ff'" onmouseout="this.bgColor='LemonChiffon'" style="cursor: hand;" onclick="passadati('<%response.Write objRS("Item")%>','<%response.Write replace(objRS("Description"),"""","\'")%>','<%response.Write objRS("BaseUoM")%>','<%response.Write formatnumber(objRS("BasePrice"),2)%>','<%response.Write objRS("discountformula")%>')">
<td><%response.Write objRS("Item")%></td>
<%
if objRS("Producer")="" then
%>
<td align="center">-</td>
<%
else
Set objviewProd = Server.CreateObject( "ADODB.Connection" )
objviewProd.Open "Provider=SQLOLEDB;Server=ss02;Database=Simonetto;Uid=sa;Pwd=sa;"
set objRSProd =Server.CreateObject("ADODB.Recordset")
SQLProd="SELECT * FROM MA_Producers Where Producer = '"&objRS("Producer")&"'"
objRSProd.Open SQLProd, objviewProd
%>
<td><%response.Write objRSProd("CompanyName")%></td>
<%
objRSProd.Close
set objRSProd = Nothing
objviewProd.Close
set objviewProd = Nothing
end if
%>
</td>
<td><%response.Write objRS("Description")%></td>
<td align="center"><%response.Write objRS("BaseUoM")%></td>
<td align="center"><%response.Write objRS("Discountformula")%></td>
<td align="right"><%response.Write formatnumber(objRS("BasePrice"),2)%></td>
</tr>
<%
objRS.MoveNext
loop
objRS.Close
set objRS = Nothing
objview.Close
set objview = Nothing
%>
Un'altra cosa...ho fatto un controllo in locale ci mette un 20 sec circa, ma non credo sia rilevante