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.