ASP 101 - Active Server Pages 101 - Web06
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
VBScript Classes: Part 1 of N
Migrating to ASP.NET
Getting Scripts to Run on a Schedule

QUICK TIP:
Improve efficiency with server-side includes
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Keep Track of Multiple Current Records

So you're building an ASP page that uses data from a recordset and you realize that things would be much easier if you could just keep track of multiple current records. Guess what... you can!

Enter recordset cloning. It's not quite what you'd think it'd be. There are no sheep involved... just kidding! The Clone method doesn't create another copy of the data, but instead creates another copy of the recordset object. Because of this, it's more efficient then opening another connection to the database and any change you make to the data in one is immediatly reflected in the other.

The concept can actually get a little confusing, but there are times when it can come in handy and it's really easy to do:

Set rstClone = rstSheep.Clone

You'll now have two copies of the original recordset. They'll both contain the same records, but you can filter and move through them independently.

And if you want your new clone to be read-only, that's easy enough too:

Set rstClone = rstSheep.Clone(adLockReadOnly)

For more information on cloning, you might want to read the documentaion for the Clone method of the Recordset object from MSDN.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers