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.