Mary Haggard
Program Manager
Microsoft Corporation
June 11, 1997
The following article was originally published in Site Builder Magazine (now known as MSDN Online Voices).
Are you going to sell your product on the World Wide Web? Do you want to keep track of visitors to your site? How about an easy way for employees to access their benefits information through your intranet? Chances are you already have an open database connectivity (ODBC) database containing this information. Now you need to connect those data sources to HTML pages.
This -- I'll be honest with you -- is the hard part. There are a lot of options you can use to make it work, and at every turn you will be confronted with acronym soup. I'm going to explain some of those options, decipher the acronymns, talk about tools that can make them work, and point you to more information.
Before you start hooking databases and HTML together, consider some important issues:
Ease of deployment. It's no secret that the World Wide Web is a cheap and practical alternative to traditional client/server-based deployment, and that it provides immediate cross-platform support on the client side. It's also no secret that the tools to develop Web-based applications aren't being developed as fast as the technology is changing. Do your tools research before you plan a large-scale database project.
Ease of updates. Sending changes to HTML from a database is easier than making many manual changes. Automate repetitive HTML tasks by utilizing database technology to help save you time and make site management easier. For instance, we use database technology to automatically generate the files that fill the MSDN Online Downloads area. By automating this task, we've been able to save incredible amounts of HTML production time.
Server load. Be sure you have enough server firepower to handle the increased load of database access. Consider memory, CPU speed, Internet connection speed, disk subsystems, and other critical hardware factors. If you are expecting heavy database traffic, consider running the database application on a separate machine. Thankfully, you can often use existing database management tools and performance management tools to help balance your server load.
Database scalability and reliability. Determine how much the database is likely to grow. How will users use it? On average, how often will it be hit? What is your Web site's overall growth estimate -- in both content and readership?
Data security. By using Microsoft Internet Information Server (IIS) , you automatically extend the security model provided by Windows NT. The same is true for Microsoft SQL Server , although IIS can talk to any ODBC-aware database.
In the Web world, there are database administrators and there are HTML programmers. Most tools vendors understand that the two don't exactly speak each other's language. So, you can find HTML and scripting tools that make database access easy for Web programmers, and database tools that make HTML a snap for database folks. As a side note, if somebody ever figures out a tool to do both of these automatically, we're all going to be looking for work.
Tools to make HTML easy for database programmers include:
SQL Server 6.5 ships with several tools to help the database professional easily publish Web pages. For instance, with the SQL Server Web Assistant, an individual familiar with SQL may simply write a query, schedule when that query should be run, and enter some basic formatting information for the HTML page to be generated. Web Assistant automatically creates the Web page by inserting the query results into an HTML table. Web Assistant also configures SQL Server to perform updates either by scheduling a task or creating a trigger. This makes it very useful for retrieving data that changes on a scheduled basis, such as daily sales figures.
Internet Database Connector (IDC), part of IIS 3.0, is designed primarily for programmers who are familiar with SQL and have relatively little experience with HTML. It offers a straightforward, high-performance mechanism for integrating database content into an HTML page. Any page that references a database consists of two documents, one containing the query information and the other a standard HTML file with special syntax for referencing query data. Every time a user requests an IDC document, the query associated with it is run and the HTML page is populated with the results.
If you know your way around ODBC, HTML, and ActiveX, you'll want to check out Microsoft Active Database Connector (ADC). It uses client-side ActiveX controls to hook up to and manipulate ODBC data sources. It also helps keep traffic off the server by utilizing client-side caching. ADC makes it easy for Visual Basic developers to take traditional Visual Basic applications and move them to HTML. The download, documentation, and more information are available on the ADC Web site.
Now it's time for database access tools dedicated to the Web developer. These include:
We're deep into that acronym soup I promised. If you remember from past columns, Active Server Pages (ASP) is a server-side scripting language that is an important part of Internet Information Server. It is flexible and powerful, and includes sophisticated database access features. Active Data Objects (ADO) is the key to data access using ASP. ADO allows dynamic access to database information through OLE DB (Microsoft's next-generation data-access layer, which extends and improves on ODBC).
Active Data Objects enable Web developers to link a database to an "active" Web page to access and manipulate data. You know what this means; script code within the ASP can manipulate and format the data before returning the information to the requesting browser. On the other hand, HTML pages can be dynamically created, based on and including information stored in the SQL Server database.
Can there be too much flexibility? Of course. If you're not careful, database access using ASP and ADO can cause heavy loads on your server. Be careful with the bells and whistles, be prudent with your object calls, and get started by reading An Asp You Can Grasp: The ABC's of Active Server Pages and the ASP documentation .
If you remember anything at all from the column this time, remember these two words: Visual Interdev. Visual Interdev. (My editor tells me I have a tendency to say things twice. But sometimes I need to make a point!) Microsoft Visual InterDev provides a visual interface to help you add database features to a Web site, and it has great tools to help you manage data access. It also will generate HTML and ASP server-side scripting. The tool itself is tightly integrated with ASP, ADO, ODBC, Visual Basic Scripting Edition (VBScript), Jscript, Internet Explorer, ActiveX, and Java. A lot of us on the MSDN Online team have learned to love the data-access and ASP-development features of this tool.
The tools listed above should be used in just about every Internet-development effort involving a database. In applications that require large-scale, high-performance database development, consider using Microsoft Transaction Server (MTS). MTS defines a relatively simple application-programming model for developing distributed component-based applications. It also provides a run-time infrastructure for deploying and managing those applications.
The data-binding feature in Internet Explorer 4.0 allows users to manipulate data on the client side without multiple hits to the server . Databinding may be a viable option if you have a database application in which the user will manipulate the same set of information in different ways. More information and demos of databinding in action can be found on the Internet Explorer site.
Since taking early retirement as commander of the Starship Enterprise and joining Microsoft, Mary Haggard has worked her way through the ranks to her lifelong goal, being Program Manager for the MSDN Online Web publishing team. Mary once worked in a paper mill, so she knows pulp when she sees it.
When you feel comfortable enough with your Web skills to move up from tinkering to mastering, Microsoft has a nifty and very comprehensive tool for you in the Microsoft Mastering Series of self-paced, interactive training tools on CD-ROM.
Mastering Web Site Development Using Visual InterDev is now available through software retailers. The course covers, among other topics, Active Server Pages, accessing data in a database using Visual InterDev, ADO and the Advanced Data Connector, creating ActiveX server components with Visual Basic 5.0, and how to use Microsoft Transaction Server to manage ActiveX server components.