Problem importing data form textfile

A

a

Hi,

We are migrating our database from Access 97 to Access 2003.
In our 97 version this line worked fine:

DoCmd.TransferText acImportFixed, "HDMARTPC", "tbl3031_HDMARTPCDAT",
"C:\HdbDatabase2003\hdmartpc.dat"

But in the 2003 version I am getting error 31519 (translated):
You can't import this file.

It seems that in Access 2003 it is no longer possible to read from a
textfile with a suffix .dat,
because when I rename my sourcefile to hdmartpc.txt, I can import this file
with no problem.
I only want to use the option to rename this file as a last resort, because
in the database there are many similar lines with links to other files.

Any help is appreciated
 
A

Allen Browne

Your diagnosis is correct.

Microsoft wants you to use registered file types only.

Your choices are therefore:
- To register DAT as a file type to be handled by a text editor (such as
Notepad)

- To save the file and then Name it as something different.

- To export the file in code (using Open, Print #, etc.)
 
A

a

Thanks Allen,

In kb art. 304206 I read that editing the registry is also an option. I have
tried that and after a reboot the file imports well.
For some lines in my database that is a good solution, but I am also working
with textfiles that use 3 numbers as an extension.
I am not going to enter all possible values for these extensions, because
the number of extensions that we are using is about 500 and it is changing
from time to time.

Another MSDN search brought me to art. 239471. There is not only a
description of the DisabledExtensions key where you can add your own
extension, but also a description of the exclamation mark at the beginning
of the key values. Entering extensions without the exclamation mark, will
let Access connect to all file extensions, except the extensions in the key.
 
A

Allen Browne

Hmm. Will this software only ever be used on one computer?
Can you guarantee these extensions will be entered on future computers as
well?

If you have 500 extensions to handle, a rename would be better value to my
way of thinking.
 

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