It depends on your system constraints. If you are only developing on Windows then you can use ODBC. ODBC supports writing to text files. It is an old fashioned technology and is not very fast. However it is well supported and mature.