Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009

    Unanswered: Import Specification File error


    I have tried everything and searched everywhere trying all the fixes I saw and this does not make sense.

    I have an access 2007 db. I have a form where you are pompted to select a text file to import, and then you press the import button.

    Here is the code I have to import a TAB delimitred text file to a table:

    DoCmd.TransferText acImportDelim, "ImportSpec", TableName:="Phone_Import", FileName:=Me.importfile3, HasFieldNames:=True

    Everytime I execute this, I get a Error:

    Run Time Error 3625:
    The text file Specification "ImportSpec" does not exsist. you cannot import, export, or link using this specification.

    But it IS there.

    Can anyone provide assistance???

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    Im suspicious of the filename:=Me.importfile3
    I think that means you are trying to load a file from a control called importfile3 on the current form
    its a while since I have to use automated imports, but I seem to remember we always had to import for a specified place with as specified file name. ie the batch process copied the file to a specific location, and then the Access process looked for thsat specific file. again Im not a fan of using macros so It may be somethign to do with error handling in macros.

    does this import specification work when run manually?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2009

    yes, the import spec works fine manually.

    The filename:=Me.importfile3 references a called procedure. here is more of the code:

    Private Sub importfile3_button_Click()

    Dim strFilter As String

    strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt, *.txt)", "*.txt")
    strFileName = ahtCommonFileOpenSave(OpenFile:=True, Filter:=strFilter, flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY)
    If strFileName = "" Or IsNull(strFileName) Then
    MsgBox ("Import cancelled.")
    Me.importfile3 = strFileName
    End If

    End Sub

    If Me.importfile3 = "" Or IsNull(Me.importfile3) Then
    DoCmd****nSQL ("DELETE * FROM Phone_IMPORT")
    'DoCmd.TransferSpreadsheet transfertype:=acImport, TableName:="Phone_IMPORT", FileName:=Me.importfile3, HasFieldNames:=True
    'DoCmd.TransferText acImportDelim, "ImportSpec", TableName:="Phone_Import", FileName:=Me.importfile3, HasFieldNames:=True
    DoCmd.TransferText acImportDelim, "ImportSpec1", "Phone_IMPORT", Me.importfile3, True
    End If

    And...actually...the more i think about this, Im not sure a file specification is the answer as the file name is going to be different (the import file)

    So, question is, how can I use the DoCmd Transfertxt option to do a TAB Import?

  4. #4
    Join Date
    May 2009
    If i just use:
    DoCmd.TransferText acImportDelim, TableName:="Phone_Import", FileName:=Me.importfile3, HasFieldNames:=True

    I get an error that says that field ' field1 field 2.....etc" does not exsist in Phone_IMPORT.

    Basically, it is not reading that my import file is TAB Delimitred.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts