Hope I can get some help here...

I connect to an SQL database using ASP. I can see the records. I have a small (very basic) function written in Javascript. When I use the MoveNext in the function, it works fine. However, when I use it inside of a loop, the MoveNext does not work. Is this a known problem? Please help.

This is where I connect to the database from ASP:

Code:
<% 
Dim DeptID
...