Solved

Access 2007 - Still Having Difficult w/ Export Specifications

Posted on 2010-08-13
12
388 Views
Last Modified: 2013-11-28
I created an Export Specification (to export a table as a .csv file).

With my code, I use the DCmd.TransferText to export the data on the fly, as such:

DoCmd.TransferText acExportDelim, "quick4", "Table406", "H:\Moxy60\Interface\quick4.csv"

Every time I run my code, I get the following error:

'The text file specification 'quick4' does not exist. You cannot import, export, or link using the speciification'

I then look under Saved Exports and it IS there.  I can even run it from there.  Any ideas????
0
Comment
Question by:Tom_wbi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33433839
the "Saved Exports " are not the export specifications.

to create the export specification
1.select the table
2.File>export
3. in the Save As Type list, click Text Files (*.txt, *.csv, *.tab, *.asc), and then click Export
4. In the export text wizard select Fixed width
5 .Click Advanced
6. In the Export Specification dialog box Field Information List, correct any descrepancies

DoCmd.TransferText acExportDelim, "ExportSpecName", "TableName", "C:\myCsv.csv", True
0
 

Author Comment

by:Tom_wbi
ID: 33446584
Hi capricorn,

Where IS File->Export in Access 2007??  I can't find anything in this new version - LOL!
0
 

Author Comment

by:Tom_wbi
ID: 33446593
I might have it?

Is it Right-click Table, Select Export from the Menu?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33446619
for A2007-a2010



1) Click on external data> text file which then opens another window called "Get external data - Text file"
2) Use radio button to select "Import the source data into a new table in the current database"
3) specify the source of the file using the browse procedure the clicjk OK
4) Choose radio button to select delimited format and then click next
5) this window allows you to choose delimiter and text qualifier and if first row contains names - click next
6) This window allows you to type the name of the field in the Field Name column, choose data type, and if you want field indexed - also can choose to skip field - then click next
7) This window allows you to add primary key or designate field as such - click next

8) Click on ADVANCED button

9. in the import specification window
type the name of the field in the Field Name column
(here you can use the field names of the destination table, specify data type,
check the box Skip if you do not want to import the column)


10 click save as, give the specification a name <-- this is the specification name that you will use in the command line below


DoCmd.TransferText acImportDelim, "ImportSpecificationName", "myTableName", "C:\myCsv.csv", True


0
 

Author Comment

by:Tom_wbi
ID: 33446622
Nope, that didn't work!

Guess I'll still look for File->Export ??
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33446627
ohh  sorry you are exporting data not importing..
0
 

Author Comment

by:Tom_wbi
ID: 33446633
Sorry,

Didn't see you latest comment - will attempt these Steps right now
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33446652
anyway,

external data> text file (look in the Export group)
0
 

Author Comment

by:Tom_wbi
ID: 33446692
capricorn,

Sorry for my ignorance, BUT the detailed steps you provided above are for Import Specifications...

Here is my problem:

I have a table that I created from code, at the last step in my program, I need to Export ONLY certain fields fom that table. The way I accomplished this in the past was to create an Export Spec. etc.

I need to create an EXPORT specification that Exports ONLY those fields from this table I need to a .csv file.

I do not want to import any file or create any type of Import Specification - as a matter of fact, I don't even have a file (yet) that looks like what I want to Export because I cannot get /figure out how to create my Export Sepcification.

Also, I am BRAND New (as of Friday) to using Access 2007 so I don't really know where anything is or what the differences in capabilities between 2003 and 2007 are.

0
 

Author Comment

by:Tom_wbi
ID: 33447093
OK,

I BELIEVE I am creating the Export Specification correctly,

BUT Every time I run my code, I get an error:


"The Export Specification <nameofmyexportspec> Does Not Exist.You cannot link etc etc..."

I have created the export spec multiple different ways, my file IS produced, I can run the Export Specification from my menu even, BUT when my code gets to this line:

DoCmd.TransferText acExportDelim, "quick4", "Table406", "H:\Moxy60\Interface\quick4.csv"


I get the error stated above:

"The Export Specification <nameofmyexportspec> Does Not Exist.You cannot link etc etc..."

Is there something so obvious and basic that I am missing?  Is this a Bug in Access 2007?  Can you duplicate my error?  I don't see what the problem is?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 33447207
what you did is the export STEPS not the export specification

to create the export specification
1.right click on the table
2.select export > Text file
   click on Browse and locate the destination folder
3. (you can accept the proposed name or change it)
click Save, then click OK
4. In the export text wizard select the type (Delim Fixed) width
5. Follow the wizard, before clicking on Finish
     5a .Click Advanced
6. In the Export Specification dialog box Field Information List, correct any descrepancies

7. click save as, give the specification a name <-- this is the specification name that you will use in the command line below


DoCmd.TransferText acExportDelim, "ExportSpecName", "TableName", "C:\myCsv.csv", True




0
 

Author Closing Comment

by:Tom_wbi
ID: 33447563
Hi capricorn,

For some reason I was never getting into the 'Export Spec' wizard?? perhaps because I was clicking a checkbox to 'Save Export Steps'.

This time, I followed your instructions and since you DID NOT say to check the box, I left it unchecked--->

Lo and behold I got to the 'Export Spec' Wizard and everything worked fine.

PS I dislike Access 2007 so far - just me?

Thank you once again!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question