1

I am debugging a legacy classic asp site using VBScript. In the global.asa file, I found there are some code, I couldn't figure out where the method/property comes from. Wonder if anyone could point me out the direction, please?

Dim ArrayIndex, AllCityIDs, AllCityNames, EmployeeIDs, EmployeeNames, oEmp

    Set oCity = Server.CreateObject("EmployeeDB.City")
    Set colCities = oCity.List

    Set oEmp = Server.CreateObject("EmployeeDB.Employee")

    Redim CityEmployeeArray (colCities.Count - 1)

    ArrayIndex = 0
    ' for each City, let's build the Employee list for that city.
    for each oItem In colCities
        AllCityIDs = AllCityIDs & oItem.Index & " || "
        AllCityNames = AllCityNames & oItem.Value & " || "

        'response.Write("oItem.Index:")
        'response.Write(oItem.Index)

        Set colCityEmployees = oEmp.EmployeesByCity (oItem.Index)

        'response.Write("colCityEmployees:")
        'response.Write(colCityEmployees.Count)

        EmployeeIDs = vbNullString
        EmployeeNames = vbNullString

        for each oCityEmp in colCityEmployees
            EmployeeIDs = EmployeeIDs & oCityEmp.Index & " || "
            EmployeeNames = EmployeeNames & oCityEmp.Value & " || "
        next

        EmployeeIDs = RemoveEndDelimiter (EmployeeIDs, " || ")
        EmployeeNames = RemoveEndDelimiter (EmployeeNames, " || ")

        CityEmployeeArray(ArrayIndex) = Array(oItem.Index, Array(EmployeeIDs, EmployeeNames))

        ArrayIndex = ArrayIndex + 1
    next

    Set oCity = Nothing

End Sub

I am wondering for this line

Set colCityEmployees = oEmp.EmployeesByCity (oItem.Index)

Where does the EmployeesByCity property/method come from? And how it gets the value for colCityEmployees from the oItem.Index parameter?

I also get an error for line when run the page on local IIS

for each oCityEmp in colCityEmployees

Microsoft VBScript runtime error '800a01c3'

Object not a collection

/LM/W3SVC/5/ROOT/PHONELISTADMIN/global.asa, line 80

Any suggestions would be really appreciated.

Thank you.

Xiao Han
  • 1,004
  • 7
  • 16
  • 33
  • 1
    The `oEmp` object comes from a COM DLL that has been registered with the registry with a progid of `EmployeeDD.Employee`. From the looks of it the DLL is acting as a Data Access Layer *(see [Multitier Architecture](https://en.m.wikipedia.org/wiki/Multitier_architecture))* you may need to configure a connection before it returns the expected data. – user692942 Jan 24 '19 at 18:22
  • [Here is a link](https://stackoverflow.com/a/35985827/692942) about configuring and diagnosing registration issues with COM DLLs you may find useful. – user692942 Jan 24 '19 at 18:31
  • Thank you. I have an connection somewhere on the top defined and registered the component in the registry. But wondering where is EmployeesByCity coming from? Is that something generated from Data Access Layer? – Xiao Han Jan 24 '19 at 19:36
  • It's a method call from that registered COM DLL, so yes its coming from the DAL. – user692942 Jan 24 '19 at 22:11
  • Thank you. So I guess for properties like Index and Value of Object item oItem, they are defined in the COM DLL, right? Is there anyway I can find out what properties/function/method without the COM DLL source code? – Xiao Han Jan 25 '19 at 16:28
  • 1
    @XiaoHan you can use [OLE-COM Object Viewer](http://download.microsoft.com/download/win2000platform/oleview/1.00.0.1/NT5/EN-US/oleview_setup.exe) to view COM libraries. – Kul-Tigin Jan 26 '19 at 02:58
  • 1
    @Kul-Tigin, Thanks. For some reason, the application couldn't load due to some dll problem. But I found that within Component Services, if I go to the component, under Interfaces, then keep expanding, under Methods, I can see the methods available for each component/class. The may be another way to find out what's inside the DLLs. – Xiao Han Jan 31 '19 at 15:33

0 Answers0