Est. 1997 Intermediate

Active FoxPro Pages

ProLib Software's server-side scripting engine that embedded Visual FoxPro code in HTML pages, the FoxPro world's answer to Microsoft's Active Server Pages.

Created by Peter Herzog (ProLib Software GmbH); AFP 3.0 rewritten by Christof Wollenhaupt and Jochen Kirstätter

Paradigm Procedural (embedded xBase/Visual FoxPro), with optional object-oriented Visual FoxPro
Typing Dynamic (inherits Visual FoxPro variable typing)
First Appeared 1997
Latest Version AFP 3.0 build 612 (3 July 2012)

Active FoxPro Pages (AFP) is a server-side web scripting technology that lets developers embed Microsoft Visual FoxPro code directly in HTML pages. It is the FoxPro counterpart to Microsoft’s Active Server Pages (ASP). ASP embedded VBScript and reached data through ADO and ODBC. AFP instead ran pure xBase code: its page scripts could USE a table, SCAN through its records, and write the fields straight into HTML. It was developed at ProLib Software GmbH in Seebruck, Bavaria, starting in 1997. It gave the large community of FoxPro, dBase and Clipper programmers a way onto the web without learning a new language, and outlived both its original publisher and Microsoft’s support for Visual FoxPro itself.

History & Origins

A customer request in 1997

Peter Herzog of ProLib told the story in his paper for the European Visual FoxPro Developer Conference ‘97, held in Frankfurt from 19 to 21 November 1997. Early in 1997, ProLib was asked to build an internet solution for an international company that would show data from its FoxPro application directly on the web. The customer had one condition: experienced power users had to be able to change the code themselves, so hard-coding the pages was ruled out.

Around the same time, Microsoft’s DevDays events showed the Surplus Direct application built with Rick Strahl’s West Wind Web Connection. Herzog noted that it gave an early glimpse of “FoxPro code in HTML”. That encouraged him to build a product where, as with ASP, the code sits directly in the HTML file instead of being compiled into a Visual FoxPro program. Later accounts, such as the UniversalThread coverage of the 2004 German DevCon co-written by AFP 3.0 developer Jochen Kirstätter, date the original invention to 1996. Herzog’s own 1997 paper places the start in early 1997.

The name followed Microsoft’s release of Active Server Pages: this was ASP, but for FoxPro. By the time of the November 1997 conference, Herzog reported that the project had already reached version 2.5 and was running on several internet and intranet servers.

The FOXISAPI architecture

The first AFP was deliberately simple. A single Visual FoxPro program ran on the server, called through FOXISAPI.DLL, Microsoft’s bridge that let the IIS web server call a Visual FoxPro COM (OLE) server. A page request looked like this:

1
/scripts/foxisapi.dll/wwwpl.fox.showhtml?\\projekt\htmlseite.htm

AFP loaded the named HTML file, searched it for code, ran the code, and replaced each code block with its output, so no source code ever reached the browser. An INI file mapped each project name to a physical directory. That let several AFP projects share one server and kept the pages out of direct reach from the web. To execute code blocks at run time without compiling a PRG, the engine used Randy Pearson’s CodeBlock class, which Herzog said could run nearly the entire FoxPro command set.

The 1997 syntax used double hash marks rather than ASP’s percent signs:

##foxcode
lcs = ""
use artikel shared
scan
   lcs = lcs + Artikel.artnr + '<br>'
endscan
return lcs
##

Without the foxcode keyword, the contents were simply evaluated as an expression and inserted into the page. For example, ##ttoc(datetime())## printed the current date and time. Herzog’s paper also announced a coming release called “Advanced FoxPro Pages” with an ASP-compatible notation, so that any ASP editing tool could be used to write FoxPro code.

AFP 2.x: ASP-style pages

By the early 2000s AFP had adopted ASP’s <% %> delimiters. ProLib’s German Quickstart guide, written by Jochen Kirstätter in April 2002, shows the basic page, saved as datetime.afp:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<html>
<head>
<title>Test</title>
</head>
<body>
<%
?datetime()
%>
</body>
</html>

The familiar FoxPro ? output command sends a value to the page. Data access looked like ordinary FoxPro code wrapped around HTML table rows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<%
if not used("customer")
   use data\customer in 0
endif
select customer
scan
%>
<tr>
  <td><%?customer.cust_id%></td>
  <td><%?customer.company%></td>
  <td><%?customer.contact%></td>
</tr>
<%endscan%>

Form input was read with the fox.GetFormVar("fieldname") system function. Under the hood, AFP 2.x installed AFP.EXE as a registered OLE server. Administrators had to configure its DCOM location, launch permissions and identity (including the IUSR_ and IWAM_ web accounts) with dcomcnfg. The Quickstart listed Windows 98, Windows NT 4.0 SP6a, Windows 2000 and Windows XP as supported systems. It listed Internet Information Server 4 and later, Apache HTTP Server 2.0.32 beta and later, and O’Reilly’s WebSite as supported web servers. The Visual FoxPro runtime was required. When a script failed, AFP showed a bright red, fully annotated error page, which the guide says experienced AFP programmers called the “Red Screen of Death”.

Archived copies of ProLib’s download pages show AFP 2.3 in 2001, followed by AFP 2.4 by November 2001.

AFP 3.0: the rewrite

AFP 2.x had design limits: DCOM configuration was painful, information passed between the web server and FoxPro through files, and features were missing. In mid-2002, ProLib decided on a complete rewrite. Christof Wollenhaupt (then known as Christof Lange) and Jochen Kirstätter took on the job, and AFP 3.0 was officially released at the German Visual FoxPro DevCon in November 2002.

AFP 3.0 became a true multi-threaded ISAPI extension. Kirstätter said it was “explicitly developed having performance in mind” and that code ran “multiple times faster than the previous version 2.4”. That is the developers’ own claim: they published no benchmark workload, hardware or measurement method with it. The rewrite also brought:

  • Multi-threaded worker processes with much better memory management
  • Flexible session management that let AFP scale across web server farms
  • AFP ControlCenter, a monitoring tool for worker processes, execution times and active requests
  • A plugin interface for extending or replacing parts of the request pipeline
  • Designing, developing and debugging pages from inside Visual FoxPro without restarting the web server

ProLib’s March 2004 announcement of build 3.0.527 described the engine as running on “any ISAPI compliant Web server” such as IIS and Apache HTTPd 2.0.x, on Windows 2000, Windows XP and Windows Server 2003, based on Visual FoxPro 7 and higher.

Design Philosophy

AFP’s pitch was that FoxPro developers already had everything a web application needed, including the language. ProLib’s 2005 product description targeted web developers “struggling along” with VBA, Java, ODBC and ADO, and made several promises:

  • No new language. Page code was xBase, “ideal for dBase, Clipper and FoxPro programmers”, with a built-in language of “400+ commands and functions”.
  • No data-access layer. Because AFP did not need ODBC or ADO, FoxPro tables were opened natively. ODBC and OLE DB could still reach SQL servers when needed.
  • Edit and reload. Pages were tested live without compiling, and could optionally be compiled for speed. The current foxpert site puts it as: change the code, press F5, and see the result.
  • Any editor. Pages could be written in FrontPage, Visual InterDev or Notepad, because AFP code sat inside ordinary HTML.
  • Object orientation on demand. Visual FoxPro’s object model was available, but simple procedural scripts were enough.

Key Features

FeatureDescription
Embedded xBaseVisual FoxPro code between <% %> delimiters (##...## in the 1997 engine)
OutputFoxPro’s ? command writes values into the page
Native dataDirect USE, SCAN, SELECT and SQL against DBF tables, plus ODBC/OLE DB for remote databases
Server integrationFOXISAPI (1997), a COM/DCOM server (2.x), a multi-threaded ISAPI extension (3.0)
SessionsHTTP cookies and AFP’s own cookie-based session tracking
ExtensibilityHooks in early versions; a full plugin interface, HTTP pipe and compiler queue in 3.0
Error handlingDetailed error pages and automatic e-mail notification on errors
AdministrationAFP ControlCenter (3.0) for monitoring workers and requests

Evolution

Commercial peak (2002–2005)

After the 3.0 release, ProLib pushed AFP beyond German-speaking Europe:

  • September 2004: F1 Technologies of Toledo, Ohio, the developer of the Visual FoxExpress framework, announced it would distribute and support AFP. It planned a showcase site and a tour of the southwestern United States in April 2005.
  • October 2004: ProLib advertised AFP 3.0 in CoDe Magazine’s Visual FoxPro 9.0 focus issue.
  • Late 2004: The AFP track at the German Visual FoxPro DevCon 2004 covered AFP’s basic concepts, its plugin interface and AFP RPC, a remote procedure call mechanism ProLib had built for a customer project. Rainer Becker and Peter Herzog also previewed an AFP form builder for the Visual Extend (VFX) framework that exported Visual FoxPro forms to HTML, JavaScript and AFP. According to the UniversalThread coverage, AFP had six distributors worldwide by then.
  • March 2005: ProLib released AFP Express, a 99-euro edition for intranet developers without load-balancing clusters, Windows-service execution, plugins or extended debugging. ProLib CEO Jürgen Wondzinski explained that “most AFP applications are intranet applications”.

Insolvency and rescue (2010–2012)

ProLib Software GmbH and ProLib Tools GmbH later became insolvent. In September 2010, Berlin-based BvL Bürosysteme Vertriebs GmbH announced that it had bought all rights to Active FoxPro Pages out of the insolvency estate. BvL had been an AFP customer since AFP 2.0. It formed a partnership with Christof Wollenhaupt’s foxpert and Jochen Kirstätter’s IOS Indian Ocean Software, promising an updated release, a relaunched website, a restored activation server and support.

Build 611 followed on 20 October 2011, when the activation servers came back online. It accepted both ProLib and BvL licences, and Visual FoxPro 9.0 became the base version for all AFP tools and engines. Build 612, dated 3 July 2012, is still the download offered on the AFP website.

Current Relevance

AFP is a historical technology, though not quite a dead one. Foxpert’s AFP website, relaunched in March 2017 and carrying a 2023 copyright notice, still lists AFP Professional and AFP Enterprise licences for sale to business customers. It also describes AFPX, a form-based environment that translates Visual FoxPro-style forms into HTML and handles events with AJAX and JavaScript. No release newer than build 612 has been published, however.

AFP’s fate is tied to Visual FoxPro. Microsoft announced in 2007 that Visual FoxPro 9.0 would be the last version, and extended support ended in January 2015. The German Wikipedia’s former article on AFP concluded that the technology never established itself in the market. It gave the main reason as its dependence on Visual FoxPro, which by then survived mostly in legacy applications and fit poorly with current development practice. Any remaining AFP installations are almost certainly maintaining existing FoxPro-based intranets and web applications rather than starting new projects.

Why It Matters

Active FoxPro Pages is a clear example of a pattern that shaped late-1990s web development: once Microsoft’s ASP made “code inside HTML” the model for dynamic pages, communities built around other languages copied it for their own tools. AFP brought that model to xBase, letting existing FoxPro database programmers reuse their skills, libraries and DBF data on the web.

Its history also traces how FoxPro met the internet. AFP moved from Microsoft’s FOXISAPI bridge in 1997, through DCOM-based COM servers, to a multi-threaded ISAPI engine in 2002. Alongside West Wind Web Connection, FoxWeb and others, AFP was one of the main third-party routes for Visual FoxPro developers onto the web. It is also one of the few to survive, through an insolvency and a change of owner, well past the end of Visual FoxPro itself.

Timeline

1997
Early in the year, ProLib Software GmbH in Seebruck, Germany is asked to build a web front end for an international company's FoxPro application. Peter Herzog responds by writing an engine that runs FoxPro code embedded directly in HTML files
1997
At the European Visual FoxPro Developer Conference '97 in Frankfurt (19–21 November), Herzog presents session D-ASP, "Active FoxPro Pages/Foxisapi/Internetapplikationen". His paper says AFP has already reached version 2.5, runs ProLib's own online catalogue, and will be followed by an "Advanced FoxPro Pages" release with ASP-compatible syntax
2001
ProLib's download pages offer AFP 2.3 (archived May 2001), then AFP 2.4 (archived November 2001)
2002
Jochen Kirstätter writes the German AFP Quickstart (April 2002). It documents <% %> code delimiters, the AFP.EXE COM server with its DCOM setup, and support for IIS 4+, Apache 2.0.32 beta and WebSite on Windows 98, NT 4.0, 2000 and XP
2002
After a complete rewrite started in mid-2002 by Christof Wollenhaupt and Jochen Kirstätter, ProLib releases the multi-threaded AFP 3.0 at the German Visual FoxPro DevCon in November
2004
ProLib announces AFP 3.0.527 on 30 March, describing it as a multi-threaded ISAPI engine for IIS and Apache 2.0.x on Windows 2000, XP and Server 2003. On 27 September, F1 Technologies of Toledo, Ohio, announces it will distribute and support AFP
2005
On 21 March, ProLib launches AFP Express, a 99-euro edition for intranet use that drops load-balancing clusters, Windows-service execution, plugins and extended debugging
2010
After ProLib Software GmbH and ProLib Tools GmbH become insolvent, BvL Bürosysteme Vertriebs GmbH of Berlin buys all rights to AFP out of the insolvency estate (announced 27 September). It continues the product with Wollenhaupt's foxpert and Kirstätter's IOS Indian Ocean Software
2011
On 20 October, build 611 is released and the activation servers come back online. Visual FoxPro 9.0 becomes the base for all AFP tools and engines
2012
AFP 3.0 build 612 (dated 3 July 2012) is published as a full and update installer. It remains the current download on the AFP website
2017
On 10 March, foxpert launches a redesigned AFP website that still sells AFP Professional and Enterprise licences and describes AFPX, a form-based AJAX environment, as the project's future

Notable Uses & Legacy

ProLib Software online catalogue (prolib.de)

In his 1997 conference paper, Peter Herzog wrote that ProLib's new online catalogue of FoxPro tools was built with AFP. Archived prolib.de pages from 1999 onward carry the .afp extension, including a CeBIT 2000 section and a download area that served the AFP 2.3 and 2.4 installers.

hilo.de address search

Herzog's 1997 paper points readers to an address search on www.hilo.de as a public example of AFP in production. He adds that other AFP applications of that time sat behind corporate firewalls.

dFPUG (German-speaking FoxPro User Group) web forum

The dFPUG forum serves its news pages as .afp pages, including the 2004 announcement of AFP 3.0.527 (forum.dfpug.de/shownewsb.afp). The user group also runs an AFP-based tools site at afp.dfpug.de.

AFPages.com product website

ProLib's own AFP site ran on AFP itself. Archived pages from 2005 to 2008 show AFP's session-cookie parameter (afpcookie) in their URLs. ProLib's April 2004 news noted that its server hosted several domains running both AFP 2.4.x and AFP 3.0 applications.

Language Influence

Influenced By

Visual FoxPro Active Server Pages West Wind Web Connection

Running Today

Run examples using the official Docker image:

docker pull
Last updated: