Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Advanced
Mar 23, 2000



How to Help Your Business Become an AI Early Adopter

Use the VB Response Object to Generate Dynamic HTML Pages

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 constants
Const PageBgColor As String = 
Brian Barnett
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date