Microsoft KB Archive/252303

From BetaArchive Wiki
Knowledge Base

IDC Script Sample with Multiple SQL Statements

Article ID: 252303

Article Last Modified on 3/1/2006


  • Microsoft Internet Information Server 3.0
  • Microsoft Internet Information Server 4.0

This article was previously published under Q252303

We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:


Internet Database Connector (IDC) Scripting can support multiple complex SQL statements in one script. This provides a convenient way for using IDC to develop dynamic Web pages. The corresponding .htx file must be modified to allow multiple SQL query results to be shown from the browser. The sample IDC scripts shipped with Internet Information Server 3.0 and 4.0 only give samples of one SQL statement per IDC file.


The syntax for a IDC Script (sample) with multiple SQL statements:

Template: result.htx

SELECT  field1, field2 from Table1
+Where field1=%Variable_Name%


SELECT fld1, fld2, fld3 from Table2
+Where fld1="field_data"


As shown in this sample, you can use "AND" to connect multiple SQL statements.

The user input variable is indicated by "%Variable_Name%".

In the corresponding .htx pages, you must use one "<%Begindetail%>...<%Enddetail%>" session for each SQL SELECT statement.
The following Web site may be helpful if migrating from IDC to ASP:

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

161172 ACC97: How to Use IDC Files to Query a Secure MS Access Database

162975 ACC97: Permissions Necessary to View HTML, IDC, and ASP Files

142845 How to Use SQL Functions in *.IDC Scripts

Additional query words: IDC HTX, Internet Database Connectivity

Keywords: kbhowto KB252303