Sams Teach Yourself Visual Basic 6 in 24 Hours

Sams Teach Yourself Visual Basic 6 in 24 Hours

By Greg Perry

Follow the Wizard to the Web!

As mentioned in the introduction, Visual Basic 6 makes Internet access extremely simple. Way back in Hour 2, "Analyzing Visual Basic Programs," you learned how to start the VB Application Wizard that created an application shell for you. You now know enough of the Visual Basic language to create a shell and modify the application with specific code so that the application does the work that you need.

An intranet is a is a localized version of the Internet and is sometimes used as a local area network's protocol system.

One of the wizard's dialog boxes gives you access to the Internet. Try it yourself by following these steps:

  1. Start a new project.
  2. From the New Project dialog box (shown in Figure 24.1), double-click VB Application Wizard to start the wizard.
    24fig01.gif

    Figure 24.1 Click here to start the wizard and add Internet support.

  3. Read the dialog boxes and click Next as you follow the wizard's application design. Accept all the default values on each dialog box and pause when you come to the dialog box labeled Internet Connectivity (see Figure 24.2).
    24fig02.gif

    Figure 24.2 This wizard dialog box requests Internet support.

    A Web browser is a program that lets you display and interact with colorful Web pages on the Internet. URL (uniform resource locator) is an Internet Web site address where you can point a Web browser. URLs generally begin with http:// (which stands for Hypertext Transfer Protocol). URL addresses can also specify an FTP (File Transfer Protocol) document or even another document that resides on your computer or on another networked disk.
  4. Click Yes to request Internet support. In addition, enter a default URL in the text box. If you don't change the default URL, the Web browser will go to Microsoft's home page when the application's user displays the Web browser the first time. If your company has a home page, you might want to enter that home page's URL in the text box. If you want to make your users really smart, point them to Macmillan Publishing's home page at http://www.mcp.com.
  5. When you complete the Internet dialog box, continue clicking Next until you get to the final wizard dialog box. Click Finish to complete the wizard and watch the wizard generate your application. So far, nothing looks different from the wizard you used to create an application in Hour 2.

Close the wizard's summary dialog boxes and run the application. Figure 24.3 shows the resulting Internet-enabled application.

24fig03.gif

Figure 24.3 Where's the Internet?

Obviously, something is wrong because the application doesn't look anything like an Internet application. When you ran the wizard, you accepted a lot of dialog box default values. The wizard didn't generate an Internet application only, but rather an application that happens to contain Internet access.

Select View | Web Browser. The application will load the Web browser form and send the application to the Internet through your Internet Service Provider (ISP).

Share ThisShare This

Informit Network