Sure sounds like a homework problem. No textbook for the course? The instructor left you high and dry on how to code a cursor for loop? Absolutely no references at your disposal, and you live somewhere in China where all of the Internet's search engines are unavailable to you, but yet, somehow, dbasupport.com is available to you? Is this the case?