responded. Microsoft has released many tools to aid a developer who is using ODBC to connect to a
database. They include ODBCDirect, Remote Data Objects (RDO), Data Access Objects (DAO), and
more recently ActiveX Data Objects (ADO). They are all pretty much based on a object based approach
to data.
These tools can be used in the applications that you develop. Because most of you reading this book
are probably using MySQL for some sort of database access through the Web, the Microsoft
technologies that you will use for examples will be Active Server Pages, VBScript, and ADO. You will
use these technologies because they are simple and easy to use, and this is the direction that Microsoft
is taking. ADO is going to be the premier way to access data on the Windows platform. To do this, you
need to first cover some of the basics.
Active Server Pages
To take advantage of these technologies, you must be using a Web server with the FrontPage extensions
installed. Microsoft has these available on their Web site. They run on all platforms, including Linux. Also, the
MyODBC driver must be installed on the server that is running these scripts. Optionally, a system DSN for the
database should be created on the Web server. This will allow you to create DSN connections.
An Active Server Page (ASP) is a Web page that contains code such as VBScript and standard HTML
tags that is run in the space between the request for an ASP by the client (in this case a browser) and
fulfillment of that request by the server. It takes the place of Common Gateway Interface (CGI)
programs. CGI programs are actually programs that run and output HTML tags to the Web server. ASP
pages are different in that they are very much like a Web page—the only difference is that they contain
code that is run before they are displayed. For example, suppose that you are signing a guest book on
the Web that utilizes ASPs. You fill out the guest book form and click Submit. The Submit calls an ASP
that has code embedded in it that takes your information from the form and stores it in a database. It
also contains code that displays a Thank You message. Take a look at the following examples to get a
better understanding of the ASP process.
The first stage of the process is displaying a Web page. In the example, it is a normal form for a guest
book see Figure 13.9). You simply add your comments and click Submit. When you click Submit, your
browser passes the information contained in the guest book form as a variable to the Active Server
Page. The Active Server Page takes that variable and inserts it into a database. It then sends out a
Thank You message.
Figure 13.9 The Guest Book Form.
Take a look at Listing 13.1 for the GuestBook.asp.
Listing 13.1 Code for Guestbook.asp
<%Language=VBScript%>