How can I import a .dta file into Access?

  • Thread starter Thread starter MorganK
  • Start date Start date
M

MorganK

My archaic system only exports .dta files.
I want to import a .dta file into my Access 2007 database, without having to
change the extension.
It's a comma delimited, quote qualified file that I no problem importing
once I DO change the extension, but I'm creating it for another user and they
shouldn't have to change it.
I've tried using (simple) VBA, but it tells me I can't import the file.

Anyone have any ideas?

Thanks!
 
There's two ways:

One, if the file is not that large, then simply copy the file to a new file
name with a .txt extension.

So, you can pop up a file dialog and allow the user to "browse" to that
file. When the user selects it, you simply copy the file to a temp.txt file,
and import that.

So, in code the command to copy a file is

filecopy "from file", "to file"

You could also consider re-naming the file file...import..and then re-name
the file back

use the "name" command

name "old file" as "new file"

I like the first approach since it don't touch the original file. If the
files are REALLY large, then you might then consider the re-name file idea.
 
Back
Top