The script still runs slowly I have several ideas on how to speed my code up, but I need to know how. My code currently looks like this:<br><br>----------------------------------------------<br><br>Set Conn = Server.CreateObject("ADODB.Connection"

<br>conn.open "DSN=Architron;uid=sa;pwd="<br>Set rsbac = Conn.Execute("sp_usersnotbackedup -"&numDays&""

<br><br>if NOT rsbac.EOF then<br><br>dLastMod = DateAdd("d", -5, Now())<br> datelast = datelast<br> Response.Write dotype & "<br>"<br> dLastMod = dLastMod & "12:00:00 AM"<br> Response.Write "Current Date: " & Now() & "<br>"<br> Response.Write message<br><br>rsbac.MoveFirst<br><br>%><br><Table align="center" WIDTH="600"><br><tr><br><TD bgcolor=#CCCCCC WIDTH="100">Customer ID</TD><br><TD bgcolor=#CCCCCC WIDTH="160">Customer Name</TD><br><TD bgcolor=#CCCCCC WIDTH="160">Last Backup</TD><br> <%<br>While Not rsbac.EOF<br><br>StrQuery = "Select c.CustName,max(fd.UploadDate) as LastBackup from Customer c,FileDescription fd where c.CustID = " & rsbac("CustId"

& " and c.CustID = fd.CustId group by c.CustName" <br><br>Set rsDetail = Server.CreateObject ("ADODB.Recordset"

<br>Detail.Open StrQuery ,"DSN=Architron; UID=sa; PWD="<br><br>%><br><br> <br><tr><TD align = center BGCOLOR=#FFFFCC><% Response.Write rsbac("CustId"

%></TD><br><TD BGCOLOR=#FFFFCC><% Response.Write rsDetail("CustName"

%></TD><br><TD BGCOLOR=#FFFFCC><% Response.Write rsDetail"LastBackup"

%></TD><br></tr><br><% <br>rsbac.MoveNext<br> Wend<br>%><br> </table><br><br>-------------------------------------------------<br><br>Firstly I open I recordset (rsbac) from which I get all the CustID numbers, I then open another recordset (rsDetail) which contains the details of the customers which uses the CustID from rsbac.<br><br>In the loop While Not rsbac.EOF<br>I have <br>Set rsDetail = Server.CreateObject ("ADODB.Recordset"

<br>Detail.Open StrQuery ,"DSN=Architron; UID=sa; PWD="<br>which I think slows everthing down since I keep on having to set the recordset. I've tried moving the line<br>Set rsDetail = Server.CreateObject ("ADODB.Recordset"

<br>out of the loop, but I get errors saying the operation is not allowed if the object is open. Would it be faster if I left "Set rsDetail = Server.CreateObject ("ADODB.Recordset"

" out of the loop? how would I then make it work?<br><br>Another thing a reckon that could be slowing the process is where I have to use the rsbac. Since this gets all the custID, would it be possible to extract all the values into an array and then close the recordset. And then use an array loop to feed the values into rsDetail part of the code, this would mean I would only have to deal with one recordset. How would I do this?<br><br>Grateful for any help.<br>Thanks.<br><br><br><br>