you can use the ODBC in VC there is CRecordSet class to fecth the records from database, and then you can write the fields into a Text File