Import text file

G

Guest

I know there has to be an easy answer for this but I just couldn't find it.
I need to automate the generation of a report. The data that feeds this
report is a tab delimited text file file that has a file extension of .DFG.
When I try to import it into access, I get a message that states "You cannot
import a text file unless it has one of these extensions: txt, csv, tab, asc,
tmp, htm, html. Does anyone have any idea how can load this text file into
access without changing the name?

Thanks!
 
K

Ken Snell \(MVP\)

For security reasons, newer versions of ACCESS will not import or export
(via TransferText) text files with nonstandard files extensions -- the only
file extensions that can be used for text files for ACCESS to import them
are ".txt", ".csv", ".tab", and ".asc". To handle a ".DFG" file extension,
see these Knowledge Base articles:

ACC2000: Importing or Linking a Text File Fails for a File That Does Not
Have a Valid File Name Extension
http://support.microsoft.com/default.aspx?id=304206

ACC2000: "Can't Update. Database or Object Is Read-only" Error Message When
You Import or Export Files
http://support.microsoft.com/default.aspx?scid=kb;[LN];245407

ACC2000: How to Import a Text File That Has an Extension That Access Does
Not Recognize
http://support.microsoft.com/?id=306144

(The renaming of the file is the preferred method.)
 
A

Albert D. Kallal

If the text file is reasonable small, then use the filecopy command and make
a copy with your desired extension


the filecopy command will do this for you. so, if you popup a file browse
dialog, you can make a copy of the user selected file, they never have to
know that your making a copy.

syntax is:

filecopy "old name","new name"

You can also rename the file...and re-name it back (using name command), but
that a bad idea if you not to actually re-name the file (if you code stops,
or freezes, then the file name will not be named back...and the user will
think the file been deleted, or damaged...so, the copy idea is the most safe
approach).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top