Internet Database Connector Examples

Below are links to several examples that use the Internet Database Connector. Although the Internet Database Connector can use any 32 bit ODBC driver that supports System DSNs, these samples use Microsoft SQL Server.

For the samples to run without modification, the SQL Server's sa account must be accessible from your computer and the sa account must have no password requirement. (This is the default installation for Microsoft SQL Server.) If you cannot or do not want to use the sa account for these samples, you can edit the Username field (and add a Password field if necessary) in the .idc files used in the samples to a valid user account.

To set up these samples, create an ODBC system data source on the Internet Server named Web SQL that refers to the SQL Server you want to use. Use the ODBC applet in the control panel to create the system DSN, or click here to create it using one of the ODBC datasource tools provided with the Microsoft Internet Information Server. Creating ODBC data sources from the Control Panel is described in Chapter 8 of the Microsoft Internet Information Server Installation and Planning Guide.

Once the Web SQL data source has been created, you can try the examples below.

Sample Guestbook Application

A guestbook is a Web application that visitors to your site can use to leave their names and comments. This application also allows users to query over the entries stored in the guestbook.

Before using the guestbook, your must first create a table using the Web SQL ODBC system DSN for SQL Server described above. The guestbook data will be stored on the SQL Server. You only need to do this once.

Once you have done so, you can use the Guestbook.

If you wish to create a guestbook application for your site, or just want to learn more about the Internet Database Connector, you should look at the Internet Database Connector files (.idc and .htx) used in this application for ideas. They are installed under the /scripts virtual root, in the samples subdirectory (\inetsrv\scripts\samples if you choose the defaults during setup).

Other Database Examples

The following examples require that the "pubs" sample database be installed on the SQL Server being accessed.

  Simple database query

 Query driven by a form

 Query returning data as hyperlinks