To read the article online, visit

Checklist for VB Component Trouble Shooting

By Ryan S.

When developing VB Components (or Business Objects), there are, of course, bugs and errors I run across. Here are the most common errors I find myself making, and fixes for the errors. Hope this helps!

Common Errors & Fixes

1) Did you reference ActiveX Server Pages in the Project - References area?
Fix - Click Project, References, and click ActiveX Server Pages.

2) Did you create the scripting context?
Fix -

    Public Sub onStartPage(sc as ScriptingContext)
        mySC = sc
    End Sub

3) Did you dim your objects properly?
Fix - Dim myResponse as Response

4) Is the ASP code correctly refrencing the DLL (is it the same project/class name)

Fix - CreateObject("myProject.myClass")

5) Do you have multiple components with the same Project/ClassName registered using regsvr32?
Fix - regsvr32 -u all the other component files

6) If you are using ADO, have you include the ActiveX Data Objects reference in your program?
Fix - Click Project, References, and click ActiveX Data Objects

7) If you are using ADO, are you using CreateObject("ADODB.Connection") instead of set?
Fix - Instead of CreateObject, do set myConn = CreateObject("ADODB.Connection")

8) Is PWS/IIS running?
Fix - Load it

9) Are your Property statements correct?
Fix -
For Read Only Properties

    Public Property Get PropName()
       PropName = myPropName
    End Property

For Write only Properties

    Public Property Let PropName(temp as Variant)
       myPropName = temp
    End Property

For Read/Write
Include both Properties.

10) Do you have Apartment Threading for your object?
Fix - In the Project properties, insure the threading model is set for Apartment.

Hope that solves some common errors!
God Bless from Ryan S

Article Information
Article Title: Checklist for VB Component Trouble Shooting
Article Author: Ryan S.
Published Date: Monday, May 03, 1999
Article URL:

Copyright 2019 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers