IDC - Internet Database Connector - Uses SQL to perform a query HTX - HTML Extension Template - HTML template used to format the query results (Actually, this extension can be anything.)
Datasource:coe Template:Location.htx SQLStatement:SELECT LibraryLocation, +Program , Format("date",'Long Date') as xx1, +Age, Registration, ProgramInformation +FROM "Calendar of Events" +WHERE "Calendar of Events".LibraryLocation='%LibraryLocation%';Explanation of IDC file
Datasource:Name of ODBC alias (may contain spaces) Template:Name of the template file - normally *.htx SQLStatement:SQL select statement, + additional lines must start with a plus sign + must end with semicolon;To convert a date into something usable, include
Any string which contains a space must be enclosed in double quotes, single quotes, or square brackets ([test this]). Which is used is currently just trial and error. If an MS Access query produces code with double quotes, and that code won't work, try changing them to single quotes. For instance, '%LibraryLocation%' is enclosed in single quotes because the data returned sometimes contains spaces.
An example of a query with embedded formatting HTML
Datasource:coe Template:Location.htx SQLStatement:SELECT LibraryLocation, +'<b>' & Program & '</b><br> +' & Format("date",'Long Date') & ', ' & Format("Time(beg)",'Medium Time') + & ' ' & Format("Time(end)",'Medium Time') AS Dtime, +Age, Registration, ProgramInformation +FROM [Calendar of Events] +WHERE [Calendar of Events].LibraryLocation='%LibraryLocation%';This allows a field in an HTML table (Dtime) to be formatted with special fonts (bold), a line break, commas, and spaces.
Additional SQL examples are provided here.
<form action="dbf.idc" method="POST"> <p><input type="submit" name="B1" value="Submit"> <select name="city" size="1"> <option selected>Denver</option> <option>Seattle</option> <option>Bufflo</option> </select> </form> |
Datasource: odbc dbf test Template: dbf.htx SQLStatement: SELECT DISTINCT COMPANY, CITY +FROM CUSTOMER +WHERE(CITY = '%city%') +ORDER BY COMPANY, CITYdbf.htx excerpt
<p><%idc.city%> <%begindetail%> <p><%city%> *** <%company%> <p> <%enddetail%>
<%Shipper%> | <%if ShipperPhone eq ""%> <%else%><%ShipperPhone%> <%endif%> <%enddetail%> |
Since returns and tabs are ignored by web browsers, it is strongly suggested that text fields in the database contain the necessary html code to format the data.
If you plan to develop pages on your local machine, load the Microsoft Personal Web Server which is free from Microsoft. It was originally about 700K. Support for Active Server Pages (ASP) adds another 20 Meg and includes VisualBasic and JavaScript interpreters. Unfortunately, Microsoft no longer provides the smaller 700K file.
For security reasons, web servers won't execute a file unless you tell the server that the file is executable. For the Microsoft servers, this is accomplished by running the Server Administration application. With the Personal Web Server, this is done by double clicking on the icon in the system tray. You need to Add a directory, Assign an alias, and make the directory Executable. Once this is done, the IDC and HTX files should be placed in that directory and referenced as http://serverName/alias/YourName.idc.
There are a number of additional security/permission problems related to getting IDC/HTX database access to work when using Windows NT. (Windows 95 does not have these problems ... but it also has no security :) Basicly, IIS does its work as IUSR_servername which needs full access to several sources including the database files and the system temporary directory. Details