You have seen, so far, how to use the Recordset Design Time Control and data bound controls to include database access to theVirtualBookShelf.com project.
These controls are easy to implement, taking just a few moments to drag and drop them into a Web page.
You can also write script that creates database access in a more direct manner. Perhaps you want, or need, to design a
rather than using that provided by the DTCs in Visual InterDev.
Also, by writing your own script, the size of the pages remain smaller and are, therefore, faster to load.
You can use the Data Environment (DE) object to create script-based database access.
The Data Environment contains the information necessary to access a database and is defined in the Global.asa file.
You will recall that you added a DE to a project in Module II and have been using it since then.
To script the DE, you need a database connection and one or more command objects. The command objects are used to access a database object.
Additionally, the Scripting Object Model (SOM) must be enabled for the page. The SOM is a collection of objects that you use to script the application. Enabling the SOM gives you access to these objects.
The following MouseOver shows script that creates a DE object and uses it to create a recordset object. It is part of a file called DE.asp, which you can download from the Resources page for on-your-own experimenting.