Off Topic — HabitableZone

Off Topic » in reply to Re: How do you link a simple HTML form to a SQL database?

Re: How do you link a simple HTML form to a SQL database?

I need to untangle your (McFly's) explanation a bit, to make clear how it sorts out by operating system and Web server.

Microsoft's Web server, which of course runs only under various versions of Windows, is "IIS", Internet Information Server. The stripped-down version that can handle only a single Web site is Personal Web Server. You get IIS as part of the various server editions of Windows, which means the price tag is upwards of $700.

ASP runs primarily only under IIS, although if you're willing to shell out a kilobuck you can buy a third-party clone add-on for other Web servers. ASP lets you write script (VBScript or JavaScript) embedded into Web pages, that executes on the server instead of out on the browser. ASP also provides a way to call compiled ActiveX modules when you need performance or when you want to use a third-party component. This BBS software runs under ASP as a combination of script and ActiveX components.

You'd write code for a database application in IIS on ASP pages. You don't have to use SQL server for the database; you could also use the much cheaper Access, or one of several shareware/public domain databases.

For all practical purposes, there's only one other Web server around, and that's open-source Apache. Apache is available for every operating system, including Windows and, most importantly, Linux.

Apache is where we get into most of the programming environments McFly mentions. PHP, Perl (and its ASP-like variant ActiveState Perl) are open-source and mostly used under Linux (although, with a lot of pain you can make Perl work with ASP). Java Server Pages (JSP) is sort of like using ActiveX in ASP--you call Java classes from a Web-page script. I'm pretty sure it's open-source or otherwise free, but don't quote me on that.

Macromedia ColdFusion is a $commerical product available for Linux and Windows. Its focus is database applications, and doesn't seem too easy to use outside of that; in contrast, ASP, JSP, Perl and the others are general-purpose languages.

McFly mentioned IE data-binding, which is a horse of a different color. Most of the database application is implemented to run out at the browser, not at the server, by linking ("binding") HTML elements like table cells to fields in a database maintained back on the server. For basic reading and writing of database records, it's pretty simple, because the browser handles communication with the database. Kinda clunky for more sophisticated apps.

But wait, there's more...if you want to be at the bleeding edge of database technology, look into XML. A lot of databases, including SQL Server, can optionally return database records in XML format (what that is, if you're not already familiar with it, is too vast to sum up quickly; it's worth doing the research). If the browser is IE 5+ it can handle XML directly, converting an XML record into displayable HTML by way of a transformation method called XSL. Non-XML browsers like, unfortunately, Mozilla, require you to do a little work at the server to convert XML to HTML before sending it out to the browser. Someday HTML will be obsolete, and be replaced by XML/XSL. Learn XML now!

My next version of marsglobalsurveyor.com will be XML based. I was hoping to unveil it for testing at the first of the year, but as usual, it's going slower than I'd hoped. The really cool thing about it is that unlike the traditional design of a form that you send back to a server, and wait for a new page to come back, the mgs.com interface consists of a single page that never goes away. Instead, when you enter search parameters, script sends it as XML back to the server behind-the-scenes; when the response comes back, script writes it directly into the page. No more of that clunky ugliness of watching the form page get metaphorically wadded-up and thrown at the server, watching an hourglass, then watching as the new page is constructed before your eyes. Smooth as silk.

It works already in the laboratory. What's holding me up from putting it on the server is that it uses some components in common with the Zone BBS software, and installing the new upgraded components will break the Zone. I have to do some "regression testing" to reconcile the two systems.

Thus endeth the essay. More than you wanted to know?

--Robert

Log in or register to post.

The whole thread (17 posts)