TransferText run-time error 3011

psycoperl

Active Member
Joined
Oct 23, 2007
Messages
338
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
  3. Web
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
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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"
 
Upvote 0
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.
 
Upvote 0
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.)
 
Upvote 0
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!
 
Upvote 0
Re: TransferText run-time error 3011 [SOLVED]

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

Forum statistics

Threads
1,213,494
Messages
6,113,988
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top