.NET + COM + VBScript + Infinitive while loop

.NET + COM + VBScript + Infinitive while loop

am 11.01.2008 11:50:13 von Marc Vangrieken

Hi

I have a really weird problem... I'm using some .NET assemblies in
classic ASP pages (VBScript) through COM. To make it short; i have
some methods and they all return an instance of AdoRecordSetAdapter.
That type adapts a .NET DataTable to the interface of an ADO
recordset.

public class AdoRecordSetAdapter : IRecordSetDuck
{
DataTable _table;

public bool EOF
{
get
{
return ((_currentRowIndex > _lastRowIndex) ||
(_table.Rows.Count == 0));
}
}
...
}

In the VBScript, there are while loops

while not result.EOF
...
result.movenext
wend

Some of these while loop become infinitive loops and I don't know why!
Even when EOF is True before we enter the loop, it will be
infinitive. I also tried to use CBool(result.EOF) but that didn't
help. I'm suspecting that EOF isn't really the problem here; but
there's a problem with some while statement accessing the result
object. When I evaluate result.EOF with other statements (like if)
there's no problem at all...

Help... :-)