Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing a pipe delimited text file into Access using VB 1

Status
Not open for further replies.

jjk238

Programmer
Jan 16, 2003
14
0
0
US
I am trying to import a pipe delimited text file into MS Access. The code that I am messing with is:


strPath = "C:\cooper.txt"
strTable = "PIPE"
DoCmd.RunSQL "DROP TABLE " & strTable
DoCmd.TransferText acImportDelim, , strTable, strPath


I'm not sure what to put for the first parameter of acImportDelim, which asks for [SpecificationName]. I also don't know if I need to put something in for [HasFieldNames],[HTML TableName], or [CodePage].

The code may or may not be along the proper lines for this.....I'm not sure. Thanks for your help!
 
To create a specification, first import the table manually. On the last page of the import wizard, use the save button to save a specification (you give it a name - note what this is). The specification is savid with the database.

Then, use this specification name in your code. It will use all the options you had selectd in the wizard, including field name use, data format, and fields to ignore.



SeeThru
Synergy Connections Ltd - Telemarketing Services

 
Thank you!! It works perfect now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top