Visual FoxPro Case Studies

Surplus Software, Inc.
Integrating Microsoft® Visual FoxPro™ and the Web

Surplus Software, Inc. established in 1992, sells refurbished computer hardware and previous-version software. Located in Oregon's beautiful Columbia Gorge, in the town of Hood River, Surplus Software isn't your average mail order business. Because of its remote location, the company relies on telecommunications and its print catalog as links to its customers. While Surplus Software does very well as a conventional mail order business, the recent move to the World Wide Web delivered a whole new customer opportunity. When you finish reading this case study, you can see it for yourself on the Web site at www.surplusdirect.com/ . Note This link and others that follow point to servers that are not under the control of Microsoft Corporation. Please read our disclaimer before continuing.

The Surplus Direct Web site grew from a Spartan startup site averaging about 100 hits a day in March 1996, to one of the busiest sites on the Web. Their Web site, built with Microsoft® Visual FoxPro™ and other Microsoft Visual Tools , has recently been rated the busiest hardware and software reseller on the Web, and the sixth busiest consumer shopping Web site, right behind Amazon.com.

Under the guidance of Internet marketing manager Gary Gorman, and database developer Rick Strahl, the site is continually being enhanced and expanded. It serves a daily average of about 30,000 unique visitors, with recorded peaks of over 80,000. The site generates an average of from 85,000 to 120,000 Visual FoxPro back-end hits, with peaks of over 225,000. Microsoft® BackOffice™ and Visual FoxPro running on a single PC power the site.

Shopping Convenience and Low Prices

Customers use the Web site online store to attend to virtual shopping, inventory browsing, and product research needs. The site provides quick access to regular items, special sale items, and constantly changing offers, so customers want to come back. A list of weekly specials and specials displayed on rotating banners, and other Java applets provide an interactive feel to the site. New and extra-hot items are readily accessible from the main page. The dynamic inventory is generated from database information stored in a Visual FoxPro database.

Fig. 1

Figure 1. The Main Menu for the Surplus Direct shopping site.

A visitor can shop using the notion of a virtual shopping bag, then add any displayed item to the bag. As a visitor adds an item, each is tallied up including the shipping cost. A visitor can review the Order form after adding each item, to always be aware of exact selections. When a visitor wants to place an order, a secure order page— using Secure Sockets Layer (SSL)— constructs all the shipping and billing information and captures the relevant data. Credit card information is verified online in real time; an authorization request is sent to the bank. Once the dollar amount is approved, the system displays a confirmation page and sends a confirmation e-mail message to the visitor as a temporary receipt.

Fig. 2

Figure 2. A virtual shopping basket keeps track of items ordered as a visitor roams the site.

The site operates in "dual-interface mode," which caters to both newer browsers like Microsoft Internet Explorer 3.0 and Netscape, and to older browsers. The logic to handle dual interface mode is easily abstracted in a Visual FoxPro class library. Simply, it checks for browser type on every hit, reads the user's browser status and preference, and then loads the appropriate pages and page headers according to the requested interface. This single-point interface demonstrates one of the advantages of using an object-oriented approach to building a Web application.

Site Responsiveness

On today's fast-moving and ever-changing Web, fast response can be critical to the success of a site. The Surplus Direct site performs very quickly and often elicits praise from users. As stated earlier, from 35,000 to more than 80,000 daily visitors browse and buy. This translates to two to three database hits per second during peak hours—11A.M. to 2 P.M., Pacific Time—and anywhere from 85,000 to 125,000 database hits a day. Microsoft Internet Information Server (IIS) and Visual FoxPro handle this volume without blinking. And thanks to Visual FoxPro's database speed, response times are typically sub-second.

Fig. 3

Figure 3. One of several administration pages where site administrators get a real-time view of site activity, using their browser.

Behind the Site

Responsiveness and browser-specific pages are crucial to the site's success, but there is more that visitors don't see. Surplus also runs an offline Web site that uses data downloaded from a Hewlett-Packard mini-computer. Several times a day, back-end processing occurs to update inventory online, download orders from the Web site, and import them into the HP. The site provides a number of maintenance routines written using the Visual FoxPro back end application interfaced with an HTML front end. The power of the FoxPro language makes it possible to create an efficient interface to the HP and actually run the maintenance tasks directly from HTML-based links.

Using this paradigm, the entire site and all online database tasks can be administered through the HTML front end. That makes it easy for the Internet group responsible for handling the updates to interact with the application. Inventory imports, order exports, administration for special offers, and site management can all be handled using a familiar browser-based interface.

In addition to the import and export tasks, the Visual FoxPro Web application captures, tracks, and displays important visitor and shopper information in real time. The Web application captures hit, shopper, and sales data, and can report this information in real time through an HTML interface. Using IIS Active Server Pages, the site from which each visitor comes to the Surplus site is stored in the database. Then, by correlating dollars spent by each visitor with advertising dollars, Surplus can target their advertising dollars for maximum impact.

The ability to get a real a snapshot of business for the day as well as detailed information about their shoppers and sales has enabled Surplus Direct to quickly and efficiently grow their business on the Web, and to keep shoppers coming back.

Fig. 4

Figure 4. A Product Information database application provides the rich HTML content displayed on the Web and in the corporate intranet.

The team built a separate Visual FoxPro application to generate and maintain the Product Information Database. This database provides the detailed and graphical content for Web site display and for use by the phone sales staff. This application stores all information in HTML format in Visual FoxPro tables and supports editing text using a simple tag-based HTML editor. It implements custom menus and an HTML preview using the Microsoft Internet Explorer WebBrowser control, so rich content is created quickly. The information generated by this application can be used on the main Surplus Direct Web site as well on the corporate intranet site, both being accessed via Web browsers.

Site Architecture

One of the essential enablers for the site is the ability to achieve tight integration between Visual FoxPro and the Microsoft Internet Information Server. IIS makes the Internet Server API (ISAPI) available, which developer Rick Strahl used to create an integration layer for Web pages to interact with Visual FoxPro. Through ISAPI, the Web pages talk to Visual FoxPro ActiveX server components. These components retrieve data—such as information about a particular product—and combine it with HTML files to produce pages that the users read. Incoming requests in HTML become Visual FoxPro database commands, and custom Visual FoxPro classes turn FoxPro data into HTML.

The Visual FoxPro ActiveX server components can be pooled for additional scalability, and they integrate easily with the rest of the system. The Surplus site typically runs two Visual FoxPro ActiveX server components to service the request load, running on a dual processor Pentium Pro machine with 128MB of RAM. Server utilization even at peak times is under 50%, so there's a lot of room to grow with the current setup. When the time comes, additional Visual FoxPro components, processors in the Web server or even additional computers across the network running Visual FoxPro components over DCOM, can be used to scale the application to the next higher load level.

Fortunately, not every developer has to re-create Rick's ISAPI integration work, which involved the use of Microsoft Visual C++. Rick offers his West-Wind Web Connection product as shareware. It includes extensive examples and pointers for creating other integrated database Web sites. Visual FoxPro developers can also check out the FOXISAPI samples on the Visual FoxPro Owners' Web Site. While less extensive than Web Connection, they use a similar approach. You can visit the West-Wind site at www.west-wind.com/ .

Results

While the Web offers all sorts of fun and interesting prospects, it's important for businesses moving there to provide measurable value to their customers and owners. In this case, Surplus Software is pleased with the results. Surplus found that it's less expensive to process orders using the Web. Profits from Web-based orders are roughly 30% higher than through their paper-based catalog. Seventy percent of their Web customers are new customers, who presumably would not have found Surplus Direct if not for the Web, or found them sooner because of their Web presence. Perhaps most importantly, Surplus Software generated significant mind-share by building a high traffic site, gaining a high PC Meter ranking, and by a listing in Wired magazine.

Rick Strahl sums it up: "Visual FoxPro and Microsoft's other Web tools have been a pleasure for me to work with. Microsoft is providing me with the high-quality tools I need to move my clients to the Web. In this business, speed is everything, and Microsoft understands that."

Software Tools

  • Microsoft Windows NT® Server 4.0
  • Microsoft Internet Information Server 3.0 with Active Server Pages
  • Microsoft Visual FoxPro 5.0
  • Microsoft Visual C++® 5.0
  • Microsoft Visual J++™
  • Microsoft Excel
  • Microsoft FrontPage™
  • Microsoft Visual InterDev™
  • West-Wind Web Connection for Visual FoxPro


© 1997 Microsoft Corporation. All rights reserved.