Databases - Web Access

Basically, to read a database via the web, you need to place a program on the web server. To see the data, the URL points to the program and passes query parameters. The program generates the html page that is displayed.

There are several "standard" methods to accomplish this. Notice that even though the methods are "standard", most are also proprietary.
CGI A programming method where communications are via the standard input and standard output. CGI programs may be compiled or interpreted. This technique is common on Unix servers.
ISAPI A dll interface definition (api) which allows IIS/PWC to call a compiled program. Once loaded, the dll stays in memory. This is a serious problem when debugging an application, but gives significantly better performance once everything works.
NSAPI A dll interface definition (api) which allows the Netscape internet server to call a compiled program. (I don't use this.)
IDC/HTX Microsoft's proprietary interface which they wish would go away. In my opinion, this is one of the easiest methods to use - the only server configuration is an ODBC definition. The 2 files are interpreted.
ASP Microsoft's proprietary interface which replaces IDC/HTX. This allows full programming using VB script. The program is interpreted.

Some abbreviations

MS Access | Delphi


MS Access 97

Automatically creating a static html page from an MS Access 97 report sucks.

Yeah, it generates a "table", but each "row" is a separate table. And columns which don't contain data are simply omitted. The required amount of hand editing is unbelievable. Every cell has width and font tags. This really sucks.

However, saving a table to static html works pretty good.


Calling Web Pages

The following will open an html page via code. However, the Post method, does not work . (Get generates a url with the syntax shown above.)


References


Delphi 5.0

Delphi applications can be either Web Clients (which basically replace your browser) or Web Servers (called by IIS or PWS).


Web Clients

A Web Client effectively makes your application a web browser. I had to create one in order to interface a barcode reader (attached to Com1) to an MS Access database.


Web Servers

Delphi 5 supports ISAPI, NSAPI, and CGI.

From the menu, select

Then, from the wizard, you select which of the 3 types of applications you want.

Basic .dpr code for ISAPI application.

For more information, see Delphi CGI Web Server.


Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / Databases / WebAccess.html