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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically importing a textfile separated by commas into Access

Status
Not open for further replies.

VBAguy22

IS-IT--Management
Aug 5, 2003
180
CA
hello
I got a text file C:\mydata.txt
the fields are separated by commas.
I was just wondering how to import it into a table "myDataTable" programatically
I used the following lines


DoCmd.RunSQL "DELETE * FROM RATES"
filename = "C:\mydata.txt"
DoCmd.TransferText acImportFixed, "myData Import Specification", "myDataTable", filename

The funny thing is, when I manually import mydata.txt into myDataTable, using the above previously defined specs, it works perfectly fine. When I use the code above, it imports the comas (which are defined as separators in myData Import Specs) as part of the text, and the number fields are all over the place shifted.
:(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top