Similar problems occur if you're going through a standard for loop, because the items you're iterating through change with respect to the indexer of the loop.
The best way I have found is to do what you did... a while loop testing on the count of the records. You could also change the answersDeleted variable from a Boolean to an integer and increment it for each record that is skipped. Then just test to see if the count is greater than the number of records not deleted, meaning you still have more to check.
bool answersDeleted = true;
DCAnswerBO dcAnswer = new DCAnswerBO();
dcAnswer.FillByQuestionID(vDCQuestID,"");
if (dcAnswer.MoveFirst())
do
{
if (dcAnswer.DeleteCurrentRow() == 0)
answersDeleted = false;
//} while (dcAnswer.Count > 0);
} while (dcAnswer.Count > 0 && answersDeleted);
bo.fill();if (bo.MoveFirst()) do { bo.DeleteCurrentRow(); } while(bo.MoveNext());
One record is always skipped becuase when the first record is delete the currentrow index is decreased to -1 then the bo is navigated which sets the currentrow to 0, when the call to MoveNext is made currentrow is increated to 1 there by skipping the second record in the table.
Being from a FoxPro background I was looking at this structure as a replacement for the SCAN ENDSCAN construct. I can see that it would work for looping thru records easily but what do you recommend when looping and doing deletes? I was thinking of just using
while(bo.count > 0)
I just wanted to point this out so that other FoxPro converts don't run into the same issue and not even realize it.