Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2007 - Still Having Difficult w/ Export Specifications

Posted on 2010-08-13
12
Medium Priority
?
398 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 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
Industry Leaders: 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 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

971 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