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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Import Text File

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
I have the following code which imports text into a new table in my database.

Code:
Dim RecordCount As String
DoCmd.DeleteObject acTable, "tblImportedData"
DoCmd.TransferText acImportDelim, "DataImport", "tblImportedData", Me.txtFilename, True, ""
RecordCount = DCount("*", "tblImportedData")
CurrentDb.Execute "AppendNewLeads", dbFailOnError
Me.txtFilename = ""
MsgBox "You have successfully imported " & RecordCount & " records", vbInformation
End Sub

However, i am getting the error Runtime Error '3625'. The text file specification 'DataImport' does not exist.

I initially done a manual import and save the import steps thinking this would save as a specification?

I have looked in the MSysIMEXSpecs table MSysIMEXColumns tables and there are no records.

Any ideas why this isn't working. I am using Access 2010
 

I would think you need the complete path for the text file.

Randy
 
i thin that only if you link the table it will save the import spec
 
I figured it out guys. Thanks for your help. I was saving the import steps and not the specification
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top