Solved

Access 2007 - Still Having Difficult w/ Export Specifications

Posted on 2010-08-13
12
350 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
  • 7
  • 5
12 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
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
Comment Utility
I might have it?

Is it Right-click Table, Select Export from the Menu?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
Nope, that didn't work!

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

Expert Comment

by:Rey Obrero
Comment Utility
ohh  sorry you are exporting data not importing..
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Tom_wbi
Comment Utility
Sorry,

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

Expert Comment

by:Rey Obrero
Comment Utility
anyway,

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

Author Comment

by:Tom_wbi
Comment Utility
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
Comment Utility
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 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now