uso questo codice x rilevare se una fattura è registrata:

strSQL2 = "SELECT * FROM entrate Where id = " & idEntrata
Set objRS2 = Server.CreateObject("ADODB.Recordset")
objRS2.Open strSQL2, objConn

if not objrs2.eof then
do while not objrs2.eof

rg = objrs2("reg")
if rg = false then
rg = "no"
else rg = "si"
end if

objrs2.movenext

loop
else

rg = "none"

end if
objrs2.close
set objrs2 = nothing




poichè nel db la fattura esaminata con idEntrata c'è sempre ed è solo e sempre una... come potrei riscrivere il tutto con una forma più contratta, senza tutte queste righe inutili...