Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 8 of 8

Thread: TransferText run-time error 3011

  1. #1
    Board Regular
    Join Date
    Oct 2007
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question TransferText run-time error 3011

    Good Evening,
    I am trying to in VBA import a csv into my table called tblCompassData and am getting the following error message:

    Run-time error '3011':

    The Microsoft Access database engine could not find the object 'CIV_MSR140714170432 2014.07.09 - 2014.07.14.csv'. Make sure the object exists and that you spell its name and the path correctly. If 'CIV_MSR140714170432 2014.07.09 - 2014.07.14.csv' is not a local object, check your network connection or contact the server administrator.
    the file name is picked using Ken Getz's file selection tool, which is called by cmdSelectDataFile_Click() and displayed in Me.txtFile

    the file is located on a shared Mapped drive in the path: R:\CIV_DataFiles\

    Below is the code that I am using.

    Any advice you can offer would be greatefully appreciated.

    Code:
    Private Sub cmdProcess_Click()
    
    If MsgBox("Are you sure that you wish to load data file " & Me.txtFile.value & " into " & CIV_AppName & "?", vbYesNo, CIV_AppName) = vbYes Then
        MsgBox "PROCESS FILE"
        Debug.Print Me.txtFile.value
        
        DoCmd.TransferText acImportDelim, "ImportSpec_CompassIV", "tblCompassData", Me.txtFile, True
        
        MsgBox Me.txtFile.value & " has been loaded into " & CIV_AppName, vbInformation, CIV_AppName
        
    Else
        MsgBox "Processing of " & Me.txtFile.value & " has been aborted.", vbInformation, CIV_AppName
        Call cmdReset_Click
    End If
    
    End Sub

  2. #2
    Board Regular GinaWhipp's Avatar
    Join Date
    Sep 2009
    Location
    Ohio
    Posts
    124
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: TransferText run-time error 3011

    Have you tried loading the complete path to the file? So...

    Code:
    Me.txtFile = "R:\CIV_DataFiles\CIV_MSR140714170432 2014.07.09 - 2014.07.14.csv"

  3. #3
    Board Regular
    Join Date
    Oct 2007
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: TransferText run-time error 3011

    Yes. The full path is stored in the me.txtfile.

  4. #4
    Board Regular GinaWhipp's Avatar
    Join Date
    Sep 2009
    Location
    Ohio
    Posts
    124
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: TransferText run-time error 3011

    Hmm, try using the UNC Path.

  5. #5
    Board Regular
    Join Date
    Oct 2007
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: TransferText run-time error 3011

    Hi GinaWhipp,

    I tried entering the path both ways directly into the parameter for the DoCmd.TransferText and still get the 3011 error.

    Code:
    DoCmd.TransferText acImportDelim, "ImportSpec_CompassIV", "tblCompassData", "\\bctc-nas\SkillsTestData\CIV_DataFiles\CIV_MSR140714170432 2014.07.09 - 2014.07.14.csv", True
    and
    Code:
    DoCmd.TransferText acImportDelim, "ImportSpec_CompassIV", "tblCompassData", "R:\CIV_DataFiles\CIV_MSR140714170432 2014.07.09 - 2014.07.14.csv", True

    I also tried copying the file to my desktop and tried loading it from there and still got the 3011 error.

    I am now confused.

  6. #6
    Board Regular GinaWhipp's Avatar
    Join Date
    Sep 2009
    Location
    Ohio
    Posts
    124
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: TransferText run-time error 3011

    Okay, the last thing that comes to mind... import the spreadsheet manually, via the menu/ribbon, recreating you Import Specification (or create a new one) and see if that foxes the issue. (My thought process is that something doesn't match in your Import Specification or there is something wrong with it.)

  7. #7
    Board Regular
    Join Date
    Oct 2007
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool Re: TransferText run-time error 3011 [SOLVED]

    I saw BobLarson's post on 3011 error on transfertext - Access World Forums where he states:

    Access doesn't like multiple periods in the file path/name. It barfs when it comes across those. So, fix the file names so they don't have the periods except just before the CSV file type.
    Changed my file names to not have periods in the date and it WORKED!

  8. #8
    Board Regular GinaWhipp's Avatar
    Join Date
    Sep 2009
    Location
    Ohio
    Posts
    124
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: TransferText run-time error 3011 [SOLVED]

    Yeah, Bob! I will add that one to my things to check for!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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