Ciao a tutti.

Mi sono incartato in questa faccenda:

le tabelle in questione sono:

1) tabellacomposizione = ID, PLU, CodiceInterno
2) tabellascarico = ID, CodiceInterno

Importo da un file excel una serie di PLU; dovrei estrarre da tabellacomposizione tutti i PLU che sono contenuti nel file excel e, se esistono, estrarre dalla tabellascarico tutti i CodiciInterni corrispondenti a quel determinato PLU, che possono essere uno o più d'uno.

Ho scritto questo, ma restituisce fischi x fiaschi :

codice:
SQL = " SELECT * FROM " 
SQL = SQL & " TABELLACOMPOSIZIONE " 
SQL = SQL & " WHERE "
SQL = SQL & " PLU = " & strVarPLUExcel

Set Rs = server.CreateObject("ADODB.Recordset") 
Rs.Open SQL, objconn

If Not Rs.EOF Then
   Do While Not Rs.Eof

      response.write Rs("CODICEINTERNO") &"
"

xSQL = " SELECT * FROM " 
xSQL = xSQL & " TABELLASCARICO" 
xSQL = xSQL & " WHERE "
xSQL = xSQL & " COD_INTERNO = '" & Rs("CODICEINTERNO") & "' "

Set objRs = server.CreateObject("ADODB.Recordset") 
objRs.Open xSQL, objconn

If Not objRs.EOF Then

    response.write objRs("CODICEINTERNO") &"
"

end if

  Rs.MoveNext 
Loop

end if 

objRs.Close()
Set objRs = Nothing

Rs.Close()
Set Rs = Nothing

objconn.Close()
Set objconn = Nothing