Solved

Access 2007 - Still Having Difficult w/ Export Specifications

Posted on 2010-08-13
12
372 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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 Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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