Ciao a tutti,
devo estrarre da un DB un dato che non è sempre presente e inserire il - quando non c'è.

Le ho provate tutte ma non so piu cosa fare, ho fatto il controllo su rs.EOF = true o false
ho fatto un altro controllo per leggere il risultato della variabile associata al dato estratto, ho inserito il controllo con IsNull, con "" e poi non ricordo..insomma ho esaurito le idee.

La tabella da dove si estrae il dato è popolata soltanto che non c'è il dato richiesto.

Questo è il codice:


Set rssrif = Server.CreateObject("ADODB.Recordset")

With rssrif
.LockType = 3
.CursorType = 3
.CursorLocation = 3
.ActiveConnection = conn
.Open "select IDstrutture from rifstrutture where IDtrattamento = '"&Cint(IDtrattamento)&"'"
End With

Do while NOT Rssrif.EOF

IDstrutture = rssrif("IDstrutture")


if IDstrutture <> "" OR rssrif.EOF = false then
n = 0

Set rss = Server.CreateObject("ADODB.Recordset")

With rss
.LockType = 3
.CursorType = 3
.CursorLocation = 3
.ActiveConnection = conn
.Open "select struttura from strutture where IDstruttura = '"&Cint(IDstrutture)&"'"
End With

Do while NOT Rss.EOF

struttura = rss("struttura")
%>
<%=struttura&";
"%>
<%
n = n+1
RSs.MoveNext
Loop
'if IsRss.EOF) then
response.Write(RSs.EOF)
'end if

Rss.Close
Set Rss = Nothing
else
response.Write("-")
end if
RSsrif.MoveNext
Loop
Rssrif.Close
Set Rssrif = Nothing

Potete aiutarmi? Grazie