Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modifying Import Specification

Status
Not open for further replies.

KellyK

Programmer
Mar 28, 2002
212
US
Hi all,
I have created an import specification in order to import a text file to an Access table. I need to add three additional fields to the specification. I go to File | Get External Data | Import and then select the .txt file with the additional fields. I click on the advanced button to bring up my Import Specification and attempt to add the new fields to the bottom of the grid. Whenever I click on "save as", the new fields I add have disappeared from the bottom and are not included in the specification! This happens whether I save the spec with the old name, or as a new spec. Short of starting from scratch (there are 120 fields that have no column headers in the .txt file but need field names in the Access table), is there anything I can do? Thanks in advance for any help.

Kelly
 
Hi KellyK,
If you're trying to add fields to the previous Import Spec don't forget to get the spec by clicking on the 'Specs' button after you've clicked the 'Advanced' button. You must get the import spec loaded, add the fields, save the spec and then run it. If you go back to look at it remember to click the 'Specs' button in order to see the one you want otherwise it thinks your starting anew.
 
Thanks for the tip, lamarw! I found an odd workaround to get this thing working. I was aware that I needed to click the "Specs" button to get the one I wanted, but I appreciate your reply. What I ended up doing to make this work was to copy the spec into an Excel spreadsheet and then add the new records in Excel. Then I could modify the spec in Access by copying my Excel sheet and pasting it into the spec layout. I have no clue why this worked as opposed to entering them directly into the Access spec, but hopefully I can save someone some heartburn by sharing my solution.

Kelly
 
You don't need to use Excel. You can create a query based on the columns with SQL like:
SELECT MSysIMEXColumns.*
FROM MSysIMEXColumns;
Edit the results as needed being careful to maintain integrity.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 

And what I 've recently found is that, if you delete a spec's columns and import them back, the table is yours! Not a system one and not hidden unless you hide it! And the best thing is that you can directly edit it!

I dread to find the disadvantages though!!!!
 
An alternative approach is to use a schema.ini file which defines that characteristics of text file(s) to be imported. This can be extremely useful if the text file is of varying structure and may be a good way of dedaling with this if further changes may occur in the future.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top