Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to import files without an extension in access 2000 1

Status
Not open for further replies.

zjoskebest

Vendor
Jun 15, 2004
5
NL
hello

how can i import files without an extension. Per file its about 40.000 records to many for exchange the records in *.txt files
who can help me ...? Thanks

jos bogers
 
Hi,

I don't think there is a restriction to the number of lines in a text file.

Here is a link that might help. It shows how to import a file with an extension that Access doesn't recognize.

HTH

 
p27br

I´ve files with an extension *.ab . I´ve found the solution for this extensions in Microsoft help, but without an extension I can not find anything also could you help me how to import files to access without any extension
thanks

jos
 
I forgot to post the link, sorry !

how about something like this :

First manually add a txt extension to your file, then start the import wizard and save the Import Specs. Cancel the import.
Remove the extension and run the following code (assuming all the files have the same specs and are imported to the same table.

Sub test()
Dim fso As Scripting.FileSystemObject
Dim strTmpFile As String
Dim i As Long
Set fso = New Scripting.FileSystemObject

With Application.FileSearch
.FileName = "*.*"
.FileType = msoFileTypeAllFiles
.LookIn = "C:\eisims\data"

If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
'create temp text file
fso.CopyFile .FoundFiles(i), .FoundFiles(i) & ".txt"
'import temp file to access
DoCmd.TransferText acImportDelim, "MySpecs", "MyTable", strTmpFile
'delete temp text file
fso.DeleteFile .FoundFiles(i) & ".txt"
Next i
End If
End With
set fso = nothing
End Sub
 
replace the line

Code:
 DoCmd.TransferText acImportDelim, "MySpecs", "MyTable", strTmpFile

with

Code:
 DoCmd.TransferText acImportDelim, "MySpecs", "MyTable", .FoundFiles(i) & ".txt"
 
Hello P27br

The problem is that we have with your solution a manually action 3 times a day in total 3 files loaded with about 40000 records. I want it automatically imported in ACCESS. In our previous access (1997) those files could be automatically imported in Access. (I mean files without extension) But now I´ve ACCESS 2000, it is no more possible to import the files automatically. Would you be so kind to help me out with this problem....?
Thanks
Jos

bogers.jos@lycos.nl
 
P27br

I forgot something to tell. The files to import has a txt format but no txt extension . and as Access 2000 can not read / import files without extension we have to find something else

I´m not a vendor ... I´m a user How can I change my profile ...

regards

Jos Bogers
 
You say that with acces 97 it was possible. What has changed ? Have you tried converting the old database ?

If you want to run the code at scheduled times then have a look at this link

the code I posted adds a txt extension to the file on the fly, that's the only way I can thinnk of to solve the problem.

also see FAQ181-1154 (icon for running macro from desktop)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top