ciao, vorrei fare una funzione (a cui passo la stringa SQL) in cui in essa apro la connessione al database, apro il recordset e vorrei che mi tornasse l'intero recordset

e' possibile ?

per esempio una cosa del tipo :
codice:
function esegui(strSQL_arrivata)

Set conn = Server.CreateObject("ADODB.Connection")		
conn.ConnectionTimeout = Application("ALLOT_ConnectionTimeout")
conn.CursorLocation = Application("ALLOT_CursorLocation") 
conn.CommandTimeout = Application("ALLOT_CommandTimeout")
conn.Open Application("ALLOT_ConnectionString"), Application("ALLOT_RuntimeUserName"), Application("ALLOT_RuntimePassword")

Set RSxxx = Server.CreateObject("ADODB.Recordset")
RSxxx.CursorType = adOpenDynamic
RSxxx.LockType = 3

esegui = RSxxx.open strSQL_arrivata, conn

RSxxx.close
Set RSxxx = Nothing
conn.close
Set conn = Nothing

end function


str = "select categoria from categorie where id_cat = 1 "

Set RSlocale = Server.CreateObject("ADODB.Recordset")
RSlocale.CursorType = adOpenDynamic
RSlocale.LockType = 3

RSlocale = esegui(str)

if not RSlocale.eof then

....

end if
RSlocale.close
Set RSlocale = Nothing
pero' qui mi da' errore alla riga dove c'e' :

codice:
esegui = RSxxx.open strSQL_arrivata, conn

Expected end of statement 
/111.asp, line 26 
esegui = RSxxx.open strSQL_arrivata, conn
--------------------^