I researched Windows Script Components (WSC) and was interested in their capability to integrate with ASP. I tried integrating a VB DLL with ASP. I included a reference to the Microsoft Active Server Pages Object Library (ASP.dll) in the DLL and used the Response object to write my HTML. I was surprised to find it worked when I tested it. It meant I could create a DLL that had common reusable routines for creating lists and filling combo boxes. The possibilities are endless, all in compiled VB DLL code.
The DLL has a method called ShowRecordSet that has four parameters:
- StrConnectString (the database connect string)
- StrSQL (the SQL command to execute)
- StrHeading (a heading for the table)
- ASP Response (the reference to the Response object of the ASP page)
The DLL connects to the database, executes the query, and writes out an HTML table with a header and detail line for each row in the recordset. Use this DLL CRShtml class code:
Option Explicit'Color constantsConst PageBgColor As String =