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
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:
| |
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:
| |
The familiar FoxPro ? output command sends a value to the page. Data access looked like ordinary FoxPro code wrapped around HTML table rows:
| |
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
| Feature | Description |
|---|---|
| Embedded xBase | Visual FoxPro code between <% %> delimiters (##...## in the 1997 engine) |
| Output | FoxPro’s ? command writes values into the page |
| Native data | Direct USE, SCAN, SELECT and SQL against DBF tables, plus ODBC/OLE DB for remote databases |
| Server integration | FOXISAPI (1997), a COM/DCOM server (2.x), a multi-threaded ISAPI extension (3.0) |
| Sessions | HTTP cookies and AFP’s own cookie-based session tracking |
| Extensibility | Hooks in early versions; a full plugin interface, HTTP pipe and compiler queue in 3.0 |
| Error handling | Detailed error pages and automatic e-mail notification on errors |
| Administration | AFP 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
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.