Text Files

adevera

Registered User.
Local time
Today, 03:27
Joined
Mar 2, 2005
Messages
52
I have I table which is linked to a tex file. I created a code in which it will programatically refresh the linked, however, after the refreshed process is done, it always put the first record as a Field Header.

Can somebody help me what is needed inorder not to Access automatically use the first Record of the text file as a Field Header ?

Thanks :(
 
You don't say how you're refreshing.

There should be an subroutine option to indicate whether or not you have a header record.
 
I would recommend that you import the text file instead of linking to it. Use the TransferText Method for it allows you to define if the file has headers or not.

Code:
DoCmd.TransferText acImportDelim, , "YourTable", "C:\YourTextFile.txt", True

This will delete all of the records from your table before you update your table by importing the text file. So run this line before the TransferText code.
Code:
CurrentDb().Execute "DELETE * FROM YourTableNameHere"
 
Last edited:

Users who are viewing this thread

Back
Top Bottom