Rename file with no extension

D

Don

Hello, I have a Access application that needs to load some text files. Some
of these files exist with no extension, I tried to use this syntax
name "c:\temp\file.*" as "c:\temp\file.txt" but this gives me a error
message.

Any Suggestions?

Thanks
 
D

Daniel Pineault

What do you mean by load some text files?

Are you trying to rename the files to add a txt file extension?

Please explain a little more.
 
D

Don

Yes, I need to rename the file with a txt extension before I can call a
commend such as below to load the file into Access

DoCmd.TransferText acImportFixed, "tableImportSpecification", "table1",
sDestinationFile, False

Thanks
 
D

Daniel Pineault

Why are you putting .* if as you said it does not have an extension?

I tried:

Name "c:\test" AS "c:\test.txt"

as a test and it worked fine. So in your case, you should be able to do
what you want with:

Name "c:\temp\file" AS "c:\temp\file.txt"
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 

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