Lightweight ADO class
Friday, 9 September 2005
When putting together dynamic web applications in an ASP environment, developers use ADO recordsets for the overwhelming majority of their database interfacing. Although most web applications will involve data entry forms, where the user will insert, update and delete database records, the biggest performance issues are in presenting recordset output to the client browser.
The ADO library, while extremely versatile and powerful, comes with significant overheads, both in terms of processing costs and implementation complexity. Having worked on an intranet project which required an interface to an SQL Server database with tables having 20,000+ records, I decided to write my own “lightweight” database class, utilising ADO, but without most of the junk you would never need in a web environment.
My objectives were:
- Support for inserting, updating and deleting data.
- Paging support when selecting data, with the ability to “goto” a specific page or record offset.
- Simplified implementation and error handling.
- Maximum flexibility through free-form query string support.
- Recordset XML generation.
The current version has been in use on a couple of production sites for a while now and works like a charm. The performance gains have been remarkable, especially where large tables are concerned. If you’re an ASP developer, download it and try it out yourself. It’s free in both senses of the word.
|