Creating a Virtual Directory

The default home directory for the World Wide Web service is \Inetpub\ wwwroot. Files located in the home directory and its subdirectories are automatically available to visitors to your site. You can create virtual directories to make web pages that are not stored in the home directory or its subdirectories available for viewing. A virtual directory appears to client browsers as if it were physically contained in the home directory.

For the purposes of this chapter, you created a directory called Learn_ASP on your computer (see Hands-On 28-1). In Hands-On 28-4 we will set up the Learn_ASP folder as a virtual directory.

© Hands-On 28-4: Creating a Virtual Directory

1. Open Windows Explorer and right-click the Learn_ASP folder you created in Hands-On 28-1. Select Properties from the shortcut menu.

2. In the Learn_ASP Properties window, click the Web Sharing tab (Figure 28-6). This window may look slightly different if you are using Windows 2000.

Figure 28-6: You can use the Learn_ASP Properties window to quickly set up an alias users will use to access pages in the specified directory.

3. Click the Share this folder option button. The Edit Alias window will appear, as shown in Figure 28-7.

A virtual directory has an alias, a name that client browsers use to access that directory. An alias is often used to shorten a long directory name. In addition, an alias provides increased security. Because users do not know where your files are physically located on the server, they cannot modify them.

Part V

Disctoiy:

Disctoiy:

Access permissions

0Read

□ Script source access

□ Write

1 1 Directoiy browsing

Application permissions

ONone © Scriprt

O E Hecule prdmte: scripts]

ONone © Scriprt

O E Hecule prdmte: scripts]

Figure 28-7: The Edit Alias window can be accessed from the Properties window by choosing the Share this folder button (see Figure 28-6). The directory name is automatically entered as the suggested name for the virtual directory (alias).

4. Enter NorthDB in the Alias box, as shown in Figure 28-8. In the Access permissions area, make sure that the Read permission is selected. In the Application permissions area, make sure that the Scripts option button is selected. Click OK to close the window.

When you set up a virtual directory, it is important to specify the access permissions for that directory. The Read permission allows users to access web pages. The Read permission is turned on by default. In addition, the Scripts permission should be turned on for virtual directories that will contain ASP pages.

Figure 28-8: You can change the suggested name of the virtual directory by typing your own entry in the Alias box.

Directory:

Ales: [NorthDB

Directory:

Ales: [NorthDB

Access permissions

0 Read

□ Script source access

□ Write

1 1 Directoiy browsing

Application permissions

ONone ©Scripts

O Execute [includes scripts)

ONone ©Scripts

O Execute [includes scripts)

5. When you click OK, you will see the alias NorthDB listed in the Aliases box (see Figure 28-9).

Taking Your VBA Programming Skills to the Web

Taking Your VBA Programming Skills to the Web

Figure 28-9: NorthDB is the name your browser will use to access files in the Learn_ASP folder while working with this chapter.

Figure 28-9: NorthDB is the name your browser will use to access files in the Learn_ASP folder while working with this chapter.

6. Click OK to close the Learn_ASP Properties window.

7. To ensure that all the components you need for the exercises in this chapter can be quickly accessed, copy the sample Northwind.mdb database file from the \Program Files\Microsoft Office\Office11\Samples folder to your Learn_ASP folder.

8. Ensure that the Employees.asp file you created at the beginning of this chapter is also located in the Learn_ASP folder.

Now that you have a place for storing the necessary files, let's proceed to the next section where we establish a connection with our Microsoft Access sample database.

0 0

Post a comment