A97: Create link specification from code?

L

Lee Schipper

Using Access 97

I need to link to external tab-delimited text files. I am familiar with
link specifications and the DoCmd.TransferText method, however the columns
and data types in the linked files will change over time so I cannot create
a link specification using the Link Text wizard.

I would like to create a link specification dynamically from code.

I have looked at the MSysIMEXSpecs and MSysIMEXColumns tables and they look
pretty straightforward so I am tempted to just add my specification right
there, but I would rather use a standard supported approach if one exists.

Is there a proper way to do this?

TIA!
Lee
 
D

david epsom dot com dot au

An alternative to using the link specification table
is to use a schema.ini file, which contains the same
general information.

TransferText is an Access wrapper over a Jet SQL
command. If you want to use DAO or ADO, or if you
want to put the code into a code library, if may
make sense to use a schema.ini file and ADO/DAO.

Using Jet to connect to Text files has some irritating
limitations (particularly when you have mixed numeric/
text columns), and doesn't give very good information
when you have bad data. In these situations, you may
wish to just use VB code (open file, read line etc)
instead of using Jet through ADO/DAO or through Access.
I am tempted to just add my specification right

That's OK. All the wizard does is just add data to
those tables. You can insert/delete/update in code.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top