Create Text Export Specs For Access Text Export

Hi Everyone,

Is there a way that I can create export specifications for a text file that I want to export from Access, independent of using the text export wizard in Access?  Ideally, I'd like to create a text file that states where to start and the width of the columns for each field and then use that file as the specification for the export.  

Any guidance on this would be very helpful.

Thank you.

-Anthony
LVL 1
Anthony6890Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
< independent of using the text export wizard in Access?>
why?

<Ideally, I'd like to create a text file that states where to start and the width of the columns for each field>

there is an option (fixed width)  to do this using the wizard..
Anthony6890Author Commented:
Hi Rey,

There are two reasons...

1. I will need this file export for about 8 different Access programs, and it becomes easier to just alter the text document that is used to generate the file versus having to respec out the file each time.

2. It's easier to make a change to the independent text file versus going through the wizard.  

I am aware of the wizard for fixed width, as I've been using it; however, I think it would be more efficient if I can create a base file that can be used for the export itself.
Rey Obrero (Capricorn1)Commented:
hmm..
- you may need a table like the one the wizard use when you create an export spec for fixed width.
- open the table as recordset to format your text file using VBA
Anthony6890Author Commented:
Ah ok, I was more so hoping that I could just point to this text file via vba using the export function...
PatHartmanCommented:
You need to use the export spec for this but they are pretty easy to use once you get the hang of it.  You can import or export the specs from one app to another and you can reuse them for any number of files as long as the structures are identical.

Access stores the import/export specs in two systems tables.  Right click on the top of the Nav pane and choose the option to show system objects.  This will add a list of grayed out tables starting with "MSys".  The table named MSysIMEXSpecs lists all the specs you have created and MSysIMEXColumns lists the columns for each.  SpecID is the column that joins them.

Access generally doesn't allow manual updates to MSys tables but does allow updates to these two so you can actually modify them directly without firing up the wizard.

I would use the wizard to create each new spec the first time but after that, you can modify them directly.  

The problem with the fixed width export is that the wizard is pretty simple minded and won't allow you to slip in a column and shift everything down after it.  If you wanted to create your own interface with this feature, you could probably sell it.  I'd even buy it if I liked how it worked.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.