Exporting an Access Table to a Text File in a Visual Basic Program
Posted on 2000-05-02
I have an Access 97 database called Dogs, and I have a table called Breeds. In my Visual Basic 6.0 proggie, I have a menu item called mnuFileExport. When this menu item is clicked, the table Breeds should be exported to a text file called BreedsUpdate.txt on the A: drive. How would I do this?
Here is what I have so far and it doesn't work.
Private Sub mnuFileExport_Click()
Open "C:\Windows\Desktop\Dogs.mdb" For Input As #1
Open "A:\BreedsUpdate.txt" For Output As #2
Print #1, txtType.Text; txtDescription.Text; txtPrice.Text