views:

42

answers:

1

b'h

i will be programmatically importing a text file into a table. i have saved the import steps. i will use this:

DoCmd.TransferText(TransferType, SpecificationName, TableName, FileName, HasFieldNames, HTMLTableName, CodePage)

to do the import.

this is what SpecificationName means:

Specification Name The specification name for the set of options that determines how a text file is imported, exported, or linked. For a fixed-width text file, you must either specify a specification name or use a schema.ini file, which should be stored in the same directory as the imported, linked, or exported text file.

i do need a specific specification; however i do not know how to specify one. when i manually imported a table, i did save the specifications for my import, however i do not know how to call this in the TransferText.

does anyone know how to specify SpecificationName ?

+1  A: 

When you do the import manually, you can save the import options as a specification. You assign a name to the specification at the time you create it. In Access 2003, click the Advanced button on the Import Text Wizard. Then you will get a dialog for <filename> Import Specification; click the Save As button and assign a Specification Name ... for example "MySpec".

Use that name (in quotes) as the SpecificationName option for your DoCmd.TransferText command.

HansUp
thanks so much, is it the same for 2007?
I__
I would have to start up a machine with 2007 to check. I can do that if you can't find anything similar to my description for 2003. Let me know.
HansUp
thank you very very much.
I__