Eseguo una serie di quesry ed inserisco i risultati in un array che utilizzo in seguito.
La domanda è se sia più corretto chiudere ad ogni fine query oppure no. Ovvero:
oppurecodice:SQL = "SELECT..." Set RS = Conn.Execute(SQL) if not RS.EOF then prima= true array_prima = RS.getrows numrighe_prima = ubound(array_prima,2) else prima= false end if RS.close set RS = nothing SQL = "SELECT..." Set RS = Conn.Execute(SQL) if not RS.EOF then seconda= true array_seconda = RS.getrows numrighe_seconda = ubound(array_seconda,2) else seconda= false end if RS.close set RS = nothing SQL = "SELECT..." Set RS = Conn.Execute(SQL) if not RS.EOF then terza= true array_terza = RS.getrows numrighe_terza = ubound(array_terza,2) else terza= false end if RS.close set RS = nothing
Ho provato a prendere i tempi in entrambi i casi per la creazione della pagina e non cambia praticamente nulla.codice:SQL = "SELECT..." Set RS = Conn.Execute(SQL) if not RS.EOF then prima= true array_prima = RS.getrows numrighe_prima = ubound(array_prima,2) else prima= false end if SQL = "SELECT..." Set RS = Conn.Execute(SQL) if not RS.EOF then seconda= true array_seconda = RS.getrows numrighe_seconda = ubound(array_seconda,2) else seconda= false end if SQL = "SELECT..." Set RS = Conn.Execute(SQL) if not RS.EOF then terza= true array_terza = RS.getrows numrighe_terza = ubound(array_terza,2) else terza= false end if RS.close set RS = nothing
Dal punto di vista teorico qual è la forma più corretta?
Grazie

Rispondi quotando