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

Error 3011 for TransferText 1

Status
Not open for further replies.

TracySHC

MIS
May 5, 2005
66
US
Please help - I'm using Microsoft Visual Basic 6.0 for Microsoft Access 2000 on Microsoft Windows XP Version 2002 with Service Pack 2. I'm using the following code:
DoCmd.TransferText acImportDelim, "", "AccessTableFile",
"P:\MainDirectory\SubDirectory\file.csv", 0
When I run this VBA code, I receive the following message:
Run-time error '3011':
The Microsoft Jet database engine could not find the object 'cover.csv'. Make sure the object exists and that you spell its name and the path name correctly.
Given the file name and path name are correct (I've checked several times!!!), what do I need to change in my coding to make it work? (I do not have field names in the first line of my csv file.)
Thank you for any and all help and advice,
TracySHC
 
What happens if you try to import manually the same file ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
With File/Get External Data/Import, I choose cover.csv from its directory, and receive the following error message:
The Microsoft Jet database engine could not find the object 'P:\AA faculty evaluation\Instructor Evaluations\cover.csv.csv'. Make sure the object exists and that you spell its name and the path name correctly.
What am I doing wrong?
Thank you for your response,
TracySHC
 
You really have a file named cover.csv.csv ?
Be sure that in your windows explorer folder's options the checkbox for hiding the known extensions is unticked.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
Thank you - by un-hiding known file extensions, I've changed my filename from cover.csv.csv to cover.csv. However, when I run my VBA module, I'm receiving the following error message:
Run-time error '2391':
Field 'F1' doesn't exist in destination table 'AccessTableFile.'
What is going on? Do I need to create a separate file with F1, F2, F3, etc., for importing my csv file, and then insert these records into my permanent Access table?
Thank you for all of your help and recommendations,
TracySHC
 
I do not have field names in the first line of my csv file
So, import it in a brand new table.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
Would an import file specification also work?
Thank you for all of your help,
TracySHC
 
Would an import file specification also work?
Yes, I think so.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
Thank you for all of your help! The csv file is importing to the correct ACCESS file!
Much appreciated,
TracySHC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top