473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

DoCmd.Transfer Text: export to .csv

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
4 29157
ADezii
8,834 Expert 8TB
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
603 Expert 512MB
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
603 Expert 512MB
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
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

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

Similar topics

1
by: Michael | last post by:
I have an application that will export two files to fixed width text to combine as a single text file. The first export will be a query containing header information for the file, the second query...
1
by: M Stery | last post by:
Using Transfer Text macro to create comma-delimited file of the results of union query. Underlying queries use \(999") "999\-9999! to format area code/phone number and work fine, but once the...
2
by: rxfrenc | last post by:
Hello- I have a problem trying to transfer text to a file. I need to include periods (.) in the file name, but it keeps changing them to pound signs (#). Here is what I have in the 'File Name'...
1
by: karen.p.lee | last post by:
I have just discovered a really weird problem with the TransferText method in Access 97. I was happily using this function to export a table to file then I suddenly got this error message: ...
0
by: agarwasa2008 | last post by:
A macro question. I have action:Transfer Text with the following settings: ------------------------------------ Transfer Type: import Fixed Width Specification Name: ?? Table...
3
by: agarwasa2008 | last post by:
A macro question. I have action:Transfer Text with the following settings: ------------------------------------ Transfer Type: import Fixed Width Specification Name: ?? Table...
3
by: grumpydadtl | last post by:
How can I name a text export using periods in the file name: ABC.D31.HBCVF.txt.rbd31 as opposed to something like "Export.txt"? Each time I try, Access changes the text export file name to:...
2
by: apank | last post by:
Using VBA, is there a way to transfer text a table or query and have the saved file name be some text followed by todays date (example"newfile.11.17.08.txt). Also can that file then be winzipped...
2
by: apank | last post by:
Using VBA, is there a way to transfer text a table or query and have the saved file name be some text followed by today's date (example"newfile.11.17.08.txt"). Also can that file then be winzipped...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.