Docmd.TransferText question

人盡茶涼 提交于 2020-01-05 06:49:07

问题


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:


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.



来源:https://stackoverflow.com/questions/2986456/docmd-transfertext-question

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!