Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Too many Recordsets open?


Message #1 by "Oliver Dempsey" <odempsey@b...> on Tue, 19 Dec 2000 13:29:35 -0000
This is a multi-part message in MIME format.



------=_NextPart_000_0091_01C069BF.BAB26F60

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



I have a large recordset open based on a query which takes in 4 tables.

tblPropertyOwners

tblProperties

tblRegions

tblCategories



Now I want to provide a combo box for the user to choose which owner 

that they want also.

I think the most efficient thing to do is to try and take the owners out 

of the existing recordset rather than opening a new owners recordset.

Only thing is that the owners can reoccur several times in the first 

recordset, is there any way that I can group the owners eventhough the 

recordset is already open.

The other thing that I  could do would be to use a command statement to 

open a new recordset with the owners grouped, but I still think it would 

be more efficient to try and extract them from the first recordset, am I 

right?





Regards

Oliver





---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com








Message #2 by pdf@b... on Tue, 19 Dec 2000 12:30:28 -0500
--0__=eUHuMPoqkAmLHcwNHmEZALQkziP16Z4qH9vjw4URlvwfiUTtzbSFwIkY

Content-type: text/plain; charset=us-ascii

Content-Disposition: inline







Oliver,

If your recordset is sorted on the owners, then I would suggest an ASP variable

to store the "current" owner, and then you only list the owner if it is not the

same as the "current" owner.  For example:



<!-- START CODE -->

Choose an owner:

<select name="OWNERID">

     <option value="">- Select One -</option>

<%

' Create your recordset... in this example, cRS is the recordset

Dim oID

oID = ""

Do While Not cRS.EOF

     ' Check to see if the current owner is different from the previous owner

     if oID <> cRS("OWNERID") then

          ' If the owner is different than the previous, then spit out the

select box info

%>

     <option value="<%=cRS("OWNERID")%>"><%=cRS("OWNERNAME")%></option>

<%

     ' Before moving to the next item, the current owner becomes the "previous"

owner

     oID = cRS("OWNERID")

     cRS.MoveNext

Loop



cRS.Close

set cRS = Nothing



%>

<!-- END CODE -->



In the example above, the code looks at the OWNERID field.  If the records are

not sorted by the OWNERID (or possibly OWNERNAME, if you have more than one

owner with the same name), then this will not work.



Hope this helps.

-Peter Foti













"Oliver Dempsey" <odempsey@b...> on 12/19/2000 08:29:35 AM



Please respond to "ASP Databases" <asp_databases@p...>



To:   "ASP Databases" <asp_databases@p...>

cc:    (bcc: Peter Foti)



Subject:  [asp_databases] Too many Recordsets open?







I have a large recordset open based on a query which takes in 4 tables.

tblPropertyOwners

tblProperties

tblRegions

tblCategories



Now I want to provide a combo box for the user to choose which owner that they

want also.

I think the most efficient thing to do is to try and take the owners out of the

existing recordset rather than opening a new owners recordset.

Only thing is that the owners can reoccur several times in the first recordset,

is there any way that I can group the owners eventhough the recordset is already

open.

The other thing that I  could do would be to use a command statement to open a

new recordset with the owners grouped, but I still think it would be more

efficient to try and extract them from the first recordset, am I right?





Regards

Oliver





---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!



To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com






Content-Type: text/plain; charset="us-ascii"

Content-description: footer



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com





--0__=eUHuMPoqkAmLHcwNHmEZALQkziP16Z4qH9vjw4URlvwfiUTtzbSFwIkY--


  Return to Index