if...
rs.open...
rs.close
end if


Questa in linea generale la struttura, tu l'hai mischiata.

Roby