Hello!

I am facing a problem with Win2K. i previously developed an application for WinNT 4.0
which uses a COLLECTION of objects.

On WinNT 4.0, i coded a method (let's assume ,MethodA) which accepts a collection AND internally fill this collection with some objects. The code segment which calls this method (i.e MethodA) passes a collection which is internally filled by MethodA, on return from MethodA, the calling code segment checks whether there is an object within the collection or NOT. If it has then a For Each Loop is used to iterate the collection as coded below.

Dim colBC as Collection
Dim oLines as Object
Dim lResult as Long

Set colBC = New Collection

lResult = MethodA(colBC)

If colBC.Count > 0 Then
For Each oLines In colBC
lResult = oLines.MethodX(var1,var2,....)
If lResult <> 1 Then
Goto ErrorHandler
End If
Next
End If

This code segment worked perfectly on WinNT 4.0 for nearly 10 months.
But it doesn't work on Win2K Server. I have installed Win2K SP2 and VS6 SP4.
COM+ and SQL2K, all are working perfectly on my machine BUT the code within the For Each Loop doesn't work. It shows an error (Object Required) when the following code is executed oLines.MethodX(var1,var2,....).

Even though the collection.Count returns the exact number of objects that are expected in any given scenario of my application BUT when referencing any individual item within the collection, an error occurs. I changed the datatype of object oLines from Object to Variant But it didn't work.

If anyone have had the same experience OR anyone has the solution to this problem then please respond urgently.

Regards.
Asad Ullah.