Part I: Setting Up a New Web Project

Step 1

To begin a new Web project, start Visual InterDev and choose New from the File menu. When the New dialog box appears (Figure 6-1), click the Projects tab and choose the Web Project wizard. Then specify a location for your project files in the Location box, give your project the name Bookstore, and click OK.

Figure 6-1. The New dialog box.

The Web Project wizard (Figure 6-2) will ask you for the name of the Web server on which the new project will be created. If this text box contains an entry, you can accept it; if the box is empty, type the name of the machine that is running Internet Information Server (or Personal Web Server). (If you don't know the correct name of your Web server, look up the Identification information by using the Network applet in the Control Panel.) Click Next.

The Web Project wizard will contact the selected Web server and present you with the step 2 dialog box. Choose the option Create A New Web. Make sure the name of the web is Bookstore. Check the option to enable full-text searching of the site, and click Finish.

Figure 6-2. The Web Project wizard.


Key Point

In Visual InterDev parlance, a web refers to a set of Web pages that are actually under the control of Internet Information Server. A project, on the other hand, is a set of files created and maintained by Visual InterDev.


The Web Project wizard will create your new web and open the project.

Step 2

When the Web Project wizard creates your web, several elements are provided by default. You can examine these files by clicking the FileView tab, which lists files named GLOBAL.ASA and SEARCH.HTM and a directory named IMAGES. These filenames might appear gray because they exist on the Web server but not in your working directory. Select the files in the FileView tab, and then choose Web Project/Get Working Copy from the Project menu to update your working files.

Double-click GLOBAL.ASA. This is a special file that Visual InterDev uses to track the beginning and end of user sessions. Global information regarding data access passwords can also be saved here. Visual InterDev will use this file later to initialize a data connection.

Right-click SEARCH.HTM. Choose Preview In Browser from the pop-up menu. Visual InterDev shows you the Internet Explorer search form, which is used to perform full-text searches of your Web site.

Close the open files by choosing Close All from the Window menu.

Step 3

This project utilizes a Microsoft Access database named BIBLIO.MDB to provide the online database of books, publishers, and authors. This database ships with many Microsoft development tools, including Visual Basic. In order to access this database, you must establish an ODBC data source on your machine.

Minimize Visual InterDev. You will now be working with the ODBC Data Source Administrator to create your new data source. Open the Control Panel by choosing Settings/Control Panel from the Start menu. In the Control Panel, locate the icon labeled ODBC. Double-click this icon to open the ODBC Data Source Administrator (Figure 6-3).

Figure 6-3. The ODBC Data Source Administrator.

The ODBC Data Source Administrator converts existing databases to ODBC data sources. Data sources that you create for use with Visual InterDev should be System DSN or File DSN sources. Click the System DSN tab, and click the Add button.

In the Create New Data Source dialog box, select Microsoft Access Driver and click Finish. The ODBC Data Source Administrator will display the setup dialog box for Access data sources.

In the Data Source Name text box, type WebPages for the data source. This is the ODBC alias you will use to access the database. Click the Select button, and navigate to the file BIBLIO.MDB. (You can find a copy of BIBLIO.MDB in the \CODE\DATABASES directory.) This will associate the database with the alias WebPages through the ODBC Data Source Administrator. Click OK. The data source is now established, and you can exit the ODBC Data Source Administrator.

Step 4

Maximize Visual InterDev again. Now you will add the data source to your web project. On the FileView tab, click the project title, and then choose Add To Project/Data Connection from the Project menu. When the Select Data Source dialog box appears, click the Machine Data Source tab, select the WebPages data source, and click the OK button.

Visual InterDev will add a new data connection to your web project based on the WebPages data source. This is the database that you will use to display books for sale on the site.

Note that Visual InterDev has added a new tab to your project window, the Data View tab. Click this tab, and you can view the database structure. If you double-click any table, Visual InterDev even allows you to view and edit the data.



Programming Active Server Pages
Programming Active Server Pages (Microsoft Programming Series)
ISBN: 1572317000
EAN: 2147483647
Year: 1996
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net