Developing a VBScript Class for an Extremely Lightweight Recordset Alternative - Introduction
(Page 2 of 5 )
Sure, I like the ADO Recordset. It’s seen me through my entire ASP career, and has treated me well. Arguably, the bulk of my income for this past half decade I owe to the use of ADO Recordsets. But like every client relationship, every personal relationship, every data-table relationship, we have to take stock from time to time of what we’re putting into it and getting out of it.
It occurred to me one day – while suffering over whether to give a particular Recordset object a server-side or client-side cursor – that combinations of cursors, lock-types and so on, was rarely ever exactly what I wanted. Every time there was a trade-off. For instance, did I want this Recordset to be "rewindable" (i.e. .MoveFirst resulted in something other than errors)? Well, I'd need to buy into all the other overhead of that kind of cursor. Most of the time, forward-only, fire-hose Recordsets were sufficient. Most often in my ASP work, I’m pulling a Recordset so I can count down through the data and spell out the HTML I want. But here and there, I need something different. Bookmarks. Rewindability. Whatever. But to get what I wanted, I couldn’t just do this:
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = adRewindabilityAndNothingElseDarnIt
You can’t order up your features à la carte – you have to take one of the package deals available, when it comes to Recordset features.
So I wondered, "Can't I build a lightweight replacement, with just the features I want?" That’s what I set out to do.
Next: How Much is That Recordset in the Window? >>
More ASP Articles
More By Wrox Team