PRB: ASP Returns "Error in Loading DLL" with VB ComponentID: Q178777
|
When using Visual Studio Service Pack 2 or 3, a problem may occur when you try to work with objects that have been assigned as Visual Basic collections. When you try to access any of the functions of the collection (such as count, add, or remove), or use the For...Each...Next enumerations, the following Visual Basic Script error appears:
Microsoft VBScript runtime error '800a0030' Error in loading DLL
We are researching this bug and will post new information here in the
Microsoft Knowledge Base as it becomes available.
There are two possible solutions to this problem:
Option Explicit
Private m_cList As Collection
'Add
'Purpose - Add to list
'Inputs - (String) sKey
' - (Variant) vItem
Public Sub Add(ByVal sKey As String, vItem As Variant)
m_cList.Add vItem, sKey
End Sub
'Remove
'Purpose - Remove from list
'Inputs - (String) sKey
Public Sub Remove(sKey As String)
m_cList.Remove sKey
End Sub
Public Property Get Count() As Long
Count = m_cList.Count
End Property
Public Property Get Item(sKey As String) As Variant
On Error Resume Next
If m_cList.Count > 0 Then
If IsObject(m_cList(sKey)) Then
Set Item = m_cList(sKey)
Else
Item = m_cList(sKey)
End If
End If
End Property
Public Property Get NewEnum() As IUnknown
On Error Resume Next
Set NewEnum = m_cList.[_NewEnum]
End Property
Private Sub Class_Initialize()
On Error Resume Next
Set m_cList = New Collection
End Sub
Private Sub Class_Terminate()
On Error Resume Next
Set m_cList = Nothing
End Sub
<%
'Create an instance of the new collection object.
Set objMyColl = Server.CreateObject("Project1.Class1")
If IsObject(objMyColl) Then
Response.Write "Yes, I am an object" & "<BR><BR>"
'Add some test members.
objMyColl.Add CStr("1"), "Apple"
objMyColl.Add CStr("2"), "Orange"
objMyColl.Add CStr("3"), "Banana"
'Get the count of the members.
Response.Write "I have " & objMyColl.Count & " members" & "<BR><BR>"
Response.Write "The members are: " & "<BR>"
For Each Item in objMyColl
Response.Write item & "<BR>"
Next
Else
Response.Write "Server failed to create object."
End if
%>
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Microsoft VBScript runtime error '800a0030' Error in Loading DLL
Additional query words:
Keywords : kbGenInfo kbVS
Version : WINDOWS:97sp2,97sp3
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 15, 1999