Question : Bad file number error after writing 127 text files

My app exports a database to text files. I use FREEFILE to generate a file number, and open/close the files correctly, but on writing the 128th file I get error 52, "bad file number". FREEFILE has returned "1" each time, and if I use debug to try and open file number "2", I still get the error. It is as if writing text files eats away at the program's memory, perhaps some bug with file handles not being cleared?  It's Access 2003 SP2.

Answer : Bad file number error after writing 127 text files

see this link

http://www.powerbasic.com/support/help/pbcc/index.htm#error_52_-_bad_file_name_or_number.htm

also click the  OPEN  hyperlink


HTH
Random Solutions  
 
programming4us programming4us