Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 2007 - Still Having Difficult w/ Export Specifications

Posted on 2010-08-13
12
Medium Priority
?
394 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
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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