working with text files

jatfill

Registered User.
Local time
Today, 04:46
Joined
Jun 4, 2001
Messages
150
Is there a way to clear the contents of an external file through Access? I want to import the contents of a text file into a database and then without deleting the text file itself clear all of the records I just imported, i.e. truncate the source file. I was thinking of compiling a small c++ progrqam or batch script & called that from Access, but if it can all be done in VBA, that would be a great help. thanks!
 
Try this:

Dim intFileNum As Integer
Dim strPathandFile As String

intFileNum = FreeFile
Open strPathandFile For Output As intFileNum
Print #intFileNum, ""
Close #intFileNum
 

Users who are viewing this thread

Back
Top Bottom