By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

DoCmd.Transfer Text: export to .csv

P: 1
I’m trying to use DoCmd.TransferText, (I use it successfully with a .txt export every day) to export a table into a CSV file.

Right now every time I try – it says:
Expand|Select|Wrap|Line Numbers
  1. Run-time error 3011
  2. The MS Access db engine could not find the object ‘Inventory#scv’.  Make sure the object exists and that you spell its name and the path name correctly.
I just put a simple button on a form, and linked it to the onClick action to run this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  2.     DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT", "c:\Inventory.csv", True
  3. End Sub
RTM_export: is my export specification that is saved and correct
Inspection_EXPORT: is my table name

I’ve even tried using it as a module and calling it from a macro with no success. Any idea on why I can’t get this to work?

Thanks in advance
Aug 10 '07 #1
Share this Question
Share on Google+
4 Replies


ADezii
Expert 5K+
P: 8,669
I’m trying to use DoCmd.TransferText, (I use it successfully with a .txt export every day) to export a table into a CSV file.

Right now every time I try – it says:
Expand|Select|Wrap|Line Numbers
  1. Run-time error 3011
  2. The MS Access db engine could not find the object ‘Inventory#scv’.  Make sure the object exists and that you spell its name and the path name correctly.
I just put a simple button on a form, and linked it to the onClick action to run this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  2.     DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT", "c:\Inventory.csv", True
  3. End Sub
RTM_export: is my export specification that is saved and correct
Inspection_EXPORT: is my table name

I’ve even tried using it as a module and calling it from a macro with no success. Any idea on why I can’t get this to work?

Thanks in advance
  1. Try the Export to another Directory:
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT", "c:\Test\Inventory.csv", True
  2. Try leaving the FileName Argument blank:
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT", , True
Aug 10 '07 #2

JConsulting
Expert 100+
P: 603
I’m trying to use DoCmd.TransferText, (I use it successfully with a .txt export every day) to export a table into a CSV file.

Right now every time I try – it says:
Expand|Select|Wrap|Line Numbers
  1. Run-time error 3011
  2. The MS Access db engine could not find the object ‘Inventory#scv’.  Make sure the object exists and that you spell its name and the path name correctly.
I just put a simple button on a form, and linked it to the onClick action to run this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  2.     DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT", "c:\Inventory.csv", True
  3. End Sub
RTM_export: is my export specification that is saved and correct
Inspection_EXPORT: is my table name

I’ve even tried using it as a module and calling it from a macro with no success. Any idea on why I can’t get this to work?

Thanks in advance
According to your error, you've got a spelling error. "scv"???

The MS Access db engine could not find the object ‘Inventory#scv’. M
.................................................. ............................^^^^^^^^^^^
Aug 10 '07 #3

JConsulting
Expert 100+
P: 603
I’m trying to use DoCmd.TransferText, (I use it successfully with a .txt export every day) to export a table into a CSV file.

Right now every time I try – it says:
Expand|Select|Wrap|Line Numbers
  1. Run-time error 3011
  2. The MS Access db engine could not find the object ‘Inventory#scv’.  Make sure the object exists and that you spell its name and the path name correctly.
I just put a simple button on a form, and linked it to the onClick action to run this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command5_Click()
  2.     DoCmd.TransferText acExportDelim, "RTM_export", "Inspection_EXPORT", "c:\Inventory.csv", True
  3. End Sub
RTM_export: is my export specification that is saved and correct
Inspection_EXPORT: is my table name

I’ve even tried using it as a module and calling it from a macro with no success. Any idea on why I can’t get this to work?

Thanks in advance
also you might try passing the last optional parameter with your command.
Expand|Select|Wrap|Line Numbers
  1.  
  2. DoCmd.TransferText acExportDelim, "specname", "queryname", "FileNameanPath", False, ""
  3.  
  4.  
J
Aug 10 '07 #4

P: n/a
I had a similar error; I solved it by editing and saving the specification. I think the problem was that when I created the spec, the export contained different fields (the spec lists each field name).
Oct 27 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.