We are running MSS SQL Server 6.5 on NT. We are using cobol as host language with ESQL. Net Express is the IDE (development enviroment).
In one of our cobol batch processing programs, we have the following scenario:

Open CR1
Fetch CR1
While <Records in the cursor CR1>
Begin
Update <table_name>....
Commit
Fetch CR1 *** This is where error occurs
End (of while loop)

As soon as we hit the fetch statement in the while loop, we get error - &#39;function sequence error (SQLstate S1010)&#39;. The sqlcode returned is 0 even after this erro and the program goes into a continous loop.
We are using SQLServer driver 2.65. We also tried intersolve NetExpress driver for SQLServer but with no success.

Any help in this regard will be really appreciated.

TIA