Microsoft Corporation
April 2, 1997
We've compiled a toolbox that will help you extend the capabilities of Microsoft Internet Information Server (IIS) and Active Server Pages (ASP). Featured this month (from the IIS site):
IDC/HTX to ASP converter (IDC2ASP)
IDC2ASP is a tool that allows users to migrate IDC applications to ASP quickly and easily. Microsoft has historically provided migration paths for developers to take advantage of new and better technologies. In the migration from IDC to ASP, Microsoft has teamed up with IntraActive Software to introduce IDC2ASP. The goals for IDC2ASP are to facilitate the conversion of applications, including thousands of IDC pages, to ASP in a matter of minutes, and to be easy to use without requiring specialized programming. This allow users to take advantage of the rich scripting capabilities provided by ASP and the advanced database access features of Active Data Object (ADO) without a massive conversion effort.
IDC2ASP, which ships as both a command line utility and Active Server Component (ASC), is a source-level conversion tool that reads IDC and HTX files from top to bottom and generates ASP using Visual Basic® Scripting Edition (VBScript). It also uses ADO's properties and methods for database access. For example, IDC's begindetail keyword is replaced by the VBScript Do While loop, which navigates through a result set using ADO's MoveNext method.
IDC2ASP ActiveX Server Component was built in C++ using Active Template Libraries (ATL), and can be used in any language that supports ActiveX, including Visual Basic, C++ and Java. It is a free-threaded component that supports dual interfaces. It can also be instantiated in ASP using the following syntax:
Set MyIDC2ASP = Server.CreateObject("IntraActive.IDC2ASP")
IDC2ASP exposes several properties and methods, which can be used to control its operations. For example, SQLBatch property is used when IDC files include stored procedures that return multiple result sets. In this case, the code generated by IDC2ASP automatically creates an array of Recordset objects and utilizes the NextRecordset property exposed by ADO for multiple result set processing.
Using wildcard syntax for IDC file names, IDC2ASP can convert entire directories or portions of your applications. It can also traverse all HTX files replacing all .IDC extensions with .ASP in HTML FORM and HREF tags. IDC2ASP creates a conversion log that can be used to monitor results of the conversion process.
Using IDC2ASP is very easy. The following code segment demonstrates a simple conversion script that can be used in ASP.
Set IDC2ASP = Server.CreateObject("IntraActive.IDC2ASP") ' instantiate IDC2ASP IDC2ASP.IDCPath = "c:\Program Files\IDC2ASP\Samples"
' set input directory IDC2ASP.ASPPath = "d:\Inetpub\IDC2ASP" ' set output directory IDC2ASP.IDCSource = "*.IDC" ' process all (*.idc) files IDC2ASP.SQLBatch = True ' multiple result sets IDC2ASP.FixIDCLinks = True ' replace IDC with ASP lResult = IDC2ASP.Convert() ' start conversion process
Internet Infomation Server technologies will continue to evolve to provide increasing functionality with ever more sophistication. ASP has exciting capabilities that you will want to use. By using IDC2ASP to convert your IDC applications to ASP scripts simply and accurately, you'll jump start the migration to IIS version 3.0 technologies, and in a very short time you'll be positioned to take advantage of the rich, dynamic and personalized user experience supported by ASP.