Internet Programming with Visual Basic / Edition 1

Internet Programming with Visual Basic / Edition 1

by Budi Kurniawan
ISBN-10:
1893115755
ISBN-13:
9781893115750
Pub. Date:
09/14/2000
Publisher:
Apress
ISBN-10:
1893115755
ISBN-13:
9781893115750
Pub. Date:
09/14/2000
Publisher:
Apress
Internet Programming with Visual Basic / Edition 1

Internet Programming with Visual Basic / Edition 1

by Budi Kurniawan

Paperback

$44.95
Current price is , Original price is $44.95. You
$44.95 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Overview

From seasoned developer Budi Kurniawan comes Internet Programming with Visual Basic, which teaches experienced Visual Basic programmers how to successfully combine two key Microsoft technologies used to drive the Web: Visual Basic and Microsoft Internet Information Server (IIS). This book covers what you as a professional developer needs to know to use VB to write WebClasses that combine all the elements of a robust, scalable Internet application.

This book guides you through the process of building a browser-independent Internet application using VB. Along the way, Kurniawan provides real-world code examples and detailed explanations of exactly what is occurring at each step in the development process. He also offers thorough coverage of IIS objects and concepts used by both WebClasses and ASP applications. You'll learn how IIS applications compare with other technologies, such as ASP, and why IIS applications are much faster and more scalable.

The first part of the book begins by reviewing and comparing the performance of the major Microsoft Internet technologies, including IIS applications. Kurniawan introduces the concept of IIS applications, shows how they're built, and provides related coverage of WebClasses, WebItems, and virtual directories. He also explains the role of ASP objects in IIS, the concept of ODBC and how to set up a Data Source Name connection, and the bases of Microsoft's Universal Data Access and MDAC strategies. In the second part of the book, Kurniawan discusses database optimization techniques, client-side processing, and how to manage state using the URLData property, Session object, database, cookies, and hidden fields. Finally, he addresses the crucial issues of security and successful deployment.


Product Details

ISBN-13: 9781893115750
Publisher: Apress
Publication date: 09/14/2000
Edition description: Softcover reprint of the original 1st ed.
Pages: 521
Product dimensions: 7.52(w) x 9.25(h) x 0.04(d)

About the Author

Budi Kurniawan is an IT consultant specializing in Internet and object-oriented programming, and he has taught both Java and Microsoft technologies. He is the author of Internet Programming with Visual Basic and Java for the Web with Servlets, JSP, and EJB, and he has published articles in a number of publications. Budi comes from a solid programming background, developing applications for small to multinational companies and selling software used by major organizations such as Commerce One, Saudi Business Machine Ltd, and Baxter Healthcare Corporation. Budi has a master's by research degree in electrical engineering from Sydney University, Australia, and co-owns the website hosting company Monofrog.com.

Read an Excerpt

Chapter 1: The Internet Information Server (IIS)Application

The rate at which computer science is growing is probably tiring for computer programmers who must stay on top of cutting-edge technology. Keeping up with changes in this field is more than a full-time job. Usually, you purchase a book on a new programming topic and immediately hear that another new technology has surfaced. This is especially true concerning the Internet. Technologies emerge faster than anyone can truly master.

If you are an Internet programmer or are learning to become one, you have to choose the technology you want to specialize in, but never stop watching for the new ones. When a new technology starts to become the dominant player and the one you are specializing in is in infirmity, you should be ready to climb on the new bandwagon. For example, at one time, Common Gateway Interface (CGI) was the main technology of the Internet. It is still being used, but better technologies have been invented and CGI is no longer everyone's favorite.

However, while the entire Internet industry becomes more dynamic every day, the basics remain static, so it is not too difficult to adapt to a new technology regardless of how loud the propaganda is. HTTP (currently at version 1.1) is still the protocol used and HTML (at version 4) is still the language used for content presentation on Web pages.

How Does the Internet Work?

When you surf the Internet, you basically ask for certain files located in a particular computer in a given location where those files are stored. In a typical Web site, the computer where the files are stored is expected to be up and running all the time, and its main job is to serve anyone who requests a file. Not surprisingly, this computer is called a server, more precisely: a Web server. The file returned by the Web server is displayed in the user's Web browser. Note that the term Web server can be used to refer to the computer or to the software package that is used in the Web server computer.

For this whole process of requesting a file and sending a file to happen, both the server and the user (called the client) must have a valid Internet address. The server address is something like http://www.apress.com or another type of Internet address. The client address depends on where the user accesses the Internet. When you connect to the Internet through an Internet Service Provider (ISP), for example, you are given a temporary Internet address, so the server knows where to send the requested file. When you are connected through your corporate LAN, you could have a fixed IP address or you could be given a temporary IP address also.

When you click or type in a URL, the following process happens:

  • The browser connects to the server.
  • The browser requests a file.
  • The server responds by sending the requested page to the browser, and then closes the connection.
Of course, a connection to the server can only be established if the server is running and is not too busy serving other requests.

What happens after the server sends the requested file depends on the user. The user can just close the browser and walk away or request another file from the server. However, when the server is connected for the second time, it cannot tell whether it is the second request from the same user or a first request from some other user.

The fact that the server cannot remember users who have previously requested pages has a deep impact on how an Internet application is developed. Programmers who are used to the conventional client/server programming might find it confusing at first to figure out how an Internet application works. For now, just keep this information in mind. Further discussion on this issue will be found in Chapter 7.

The architecture of an Internet application is shown in Figure 1-1.

Also keep in mind that the server does not serve only one user. For an Internet application, anyone connected to the Internet can request a page from the server. At times, in popular Web sites, thousands of requests come in simultaneously. And, if you are running a corporate intranet application, everyone with access can request a page. Therefore, it is very important for the Web application to be as efficient as possible.

The Available Technologies

In the software industry, including Web technology, Microsoft products seem to be more and more dominant. As far as Web technology is concerned, Microsoft provides a total solution. You can use Microsoft products exclusively to deliver a scalable Web solution. If you decide to do so, choosing each component in the system is easy because Microsoft products don't compete with each other. It is almost certain that you will choose Windows NT or Windows 2000 Server for your operating system, IIS as your Web server, SQL Server for your database server, and Component Object Model (COM) technology as your developing framework. The good news is, if you have been using a Microsoft compiler, you won't need to change the programming language.

On the other hand, if you are more inclined toward other products and vendors, your choice is more varied. Getting the right combination of products is often a political issue, not to mention that there is always a risk of incompatibility between products from different manufacturers. A typical Web solution without Microsoft presence could include a Unix or Linux operating system; an Apache (still the most popular today) or a Java Web server; a MySQL, Oracle, Informix, Sybase, or other database; and PERL or PHP or Java as your language of choice. However, because you have chosen this book from the shelf, chances are you are using Microsoft products. If you are new to Microsoft's Internet technologies, please read the next section. It describes the existing technologies and the position of each.

The Facts about Microsoft Internet Technologies

Before the arrival of the IIS applications technology in Visual Basic, there were and still are three types of Web applications in use that can run using IIS. They are Common Gateway Interface (CGI), Internet Server Application Programming Interface (ISAPI), and Active Server Pages (ASP).

CGI is easy to program and is the slowest Web technology available on the Windows platform. In Windows operating systems, the Web server creates a separate process for each HTTP request and communicates with the process through environment variables and standard input () and standard output ) streams. If 1,000 clients access a CGI application at the same time, the server creates 1,000 instances of the CGI application to handle the requests. Each instance requires its own memory space and system resources.

Because process creation and interprocess communication are time and resource consuming operations, it's not surprising that a CGI application is the slowest compared with other available technologies. CGI applications are usually implemented as a C/C++ executable or with a scripting language like PERL. The output of a CGI application is generated using the basic output functions of the language, for example, printf in C. CGI programs are not as bad in Unix, which is designed to handle multiple processes with very little overhead.

ISAPI is the fastest among the three applications and was developed specifically for IIS as a high-performance Windows alternative to CGI. ISAPI is an API for developing extensions to the IIS server and other HTTP servers that support the ISAPI interface. Compiled as a runtime dynamic link library (DLL) file, the ISAPI model reduces the overhead required by multiple requests because only one DLL is needed for multiple requests.

The first time an ISAPI DLL is requested, the server loads it into memory. Unless the Web server is shut down, the DLL stays in memory waiting for another request. Therefore, there is no overhead for process creation after the first request. Furthermore, ISAPI applications run in the same address space as the Web server and have access to all the same resources. There is no need for interprocess communication. However, ISAPI applications development is also the hardest, requiring implementation using C++/MFC. This factor alone deters many from selecting this solution.

There is also a maintenance problem with ISAPI. Even a minor change requires a recompile and relink of the ISAPI application. Also, an ISAPI DLL can cause the Web server to crash if it is not thoroughly tested before being deployed and run in the Web server process. Fortunately, with IIS 4.0 and later, you can select to run ISAPI DLLs in separate processes, with performance being sacrificed of course. Note that ISAPI applications are not the same as ISAPI filters, which are DLLs that allow preprocessing of requests and postprocessing of responses for site-specific handling of HTTP requests and responses....

Table of Contents

1 The Internet Information Server (IIS) Application.- 2 The WebClass and the WebItem.- 3 Working with ASP Objects.- 4 Accessing Databases.- 5 Database Access Optimization.- 6 Client-side Processing.- 7 State Management.- 8 File Uploading.- 9 Working with E-mail.- 10 Securing Your Server.- 11 Installable Components.- 12 Deploying Your IIS Application.- Appendix A HTML 4.01 Basics.- A Crash Course on HTML.- A Quick Reference to HTML Tags.- Appendix B ASP 2.0 and ASP 3.0 Built-in Objects.- Application Object.- ASPError Object (ASP 3.0 only).- Request Object.- Response Object.- Server Object.- Session Object.- Appendix C ADO 2.5 Objects and Collections at a Glance.- Appendix D Structured Query Language (SQL).- Table Data Types.- Determining Nuliability.- Retrieving Data from a Single Table.- Inserting New Rows of Data into a Table.- Updating Data.- Deleting Rows of Data.- Summary Queries.- Retrieving Data from Multiple Tables.- Data Definition.- Appendix E CDO for NTS Objects.- Properties Common to All CDO for NTS Library Objects.- AddressEntry Object.- Attachment Object.- Attachments Collection.- Folder Object.- Message Object.- NewMail Object.- Recipient Object.- Recipients Collection.- Session Object.- Appendix F IIS Applications Performance Benchmarking.- Server Variables 1.- Server Variables 2.- Database Access.- Test Results.
From the B&N Reads Blog

Customer Reviews