recordsets and ASP

Results 1 to 2 of 2

Thread: recordsets and ASP

  1. #1
    Join Date
    Dec 1969

    Default recordsets and ASP

    I have the following code which works fine but I&#039;m not happy with it. I&#039;m using the result of one recordset to provide information for the second recordset but i&#039;m creating two ado objects to do so with the open method.<BR><BR>I&#039;m sure this the most efficient way this can be done, any areas of improvement?<BR><BR><BR>[code language="VBScript"]<BR>oRs.Open sSQL, mydsn, 3, 3 &#039; adOpenStatic and adLockOptimistic are ideal cursor for a recordcount.<BR> nMyCount = oRs.RecordCount <BR> <BR> &#039; First find that est number for those jobs converted in the last 24 hours <BR> if(nMyCount &#062; 0) then &#039; If we have a record from the search show it .....<BR> oRs.MoveFirst<BR> Do While Not oRs.EOF<BR> cartItem = addCartElement()<BR> cartArray(ITEM_ESTNUM, cartItem) = oRs("est_id")<BR> oRS.MoveNext<BR> Loop<BR> end if<BR> <BR> for myloop = 0 to cartMaxUsed<BR> set oRs1=Server.CreateObject("ADODB.recordset")<BR> sSQL = "SELECT distinct p.quantity FROM tblpurchquote p WHERE p.est_id = &#039;" &_<BR> cartArray(ITEM_ESTNUM, myloop) & "&#039; and ordered = &#039;y&#039;"<BR> <BR> sSQL, mydsn, 3, 3 <BR> cartArray(ITEM_QUANTI, myloop) = oRs1("quantity")<BR> oRs1.Close<BR> Set oRs1 = Nothing<BR> <BR> next<BR>[/code]<BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default YUCK

    see if this helps<BR><BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts