Manipulating Import Specs

AlanSearle

New member
Local time
Today, 19:03
Joined
Sep 7, 2011
Messages
5
Hi Everyone,

I use a range of Import Specs to connect external (text and csv) data to an mdb database. This works fine.

However, I would like to create and adapt these specifications using VBA and am not sure how to handle this. Are there (maybe?) internal/system tables that handle these specifications? And is it possible to access these programmatically?

Many thanks for any tips/links/howtos that you can give me.

Regards,
Alan Searle
Cologne and Bonn
 
Hi Alan,

I neede somthing like that a few yers ago, and couldn't find how yo do it. I havn't then posted it anyware, but I remember seeing someware it couldn't be done.
In my case, I have a third party send Data in the same structure, but delimited diferently (CSV, Tab, Bar'|' etc.).
what I aventualy did was create a few Import specifications, link to the data using each one, and checking where the data is of the expected type. only then do I preform the full Import & update.

this method wors fine ever sins Aug 2008.

Good luck
 
For what it's worth (from another forum)

The specs are located in system files MSysIMEXSpecs and MSysIMEXColumns.
Since they are tables I suppose you can modify them but probably not easy
and you may not be able to write to system files.
The name of export Specs is located in the XSpecs table and the ID assigned,
then the column definitions and spacing are in the XColumns table by ID
number. I think if you look at them you will be able to easily identify what
is going on.

Just start a manual import as usual, select the import spec you want to modify, which does most of the hard work for you, and then make changes to it as needed. Finally save it with a different name with the 'Save As' button on the Import Specification dialog box.
 
I wrote my own import system with far more elaborate specs which also allow lines to be conditionally skipped. It opens the file as a TextStreamObject, reads it in line by line and parses.

BTW I remember stumbling across a program with a user interface for editing the specs. I posted the link on this forum. Would have been a couple of years ago.
 

Users who are viewing this thread

Back
Top Bottom