CSV import into table not working...?

P

paul814

I'm trying to use this command to import a CSV file into a table...

DoCmd.TransferText acImportDelim, "RetSpec", "tblRet", "\\drake\subcon
\ret\data\ret.csv", False

it never does it...any ideas?

If I do a straight import using those Specifications "RetSpec" tblRet
is poppulated with the data from the CSV file without any problems.

Right above the DoCMD i have:
On Error GoTo BadImport

and BadImport is:
BadImport:
MsgBox "Ret data was NOT imported!!", vbOKOnly, "File Import
Problems"
Exit Sub

Any ideas? I always get my BadImport error.
 
J

Jeanette Cunningham

Paul,
when you say a straight import does succeed - do you mean if you use the
wizard it imports successfully?

Change your error handling to show the error number and its message like
this:

BadImport:
MsgBox Err.Number & " " & Err.Description

This will give you a better idea of what the error is and that is a step
towards fixing it.

Jeanette Cunningham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top