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

vb script using import skips first record in text file 1

Status
Not open for further replies.

barny2006

MIS
Mar 30, 2006
521
US
i have this code, which works perfect (thanks to you guys). however, after counting the records/rows imported, i noticed that when i import the text file using access user interface, it imports all records (144). but when i import using this code below, it skips the first record, and imports 143. any idea what could cause this?
Code:
Set appAccess = CreateObject("Access.Application")
db_path = "c:\stel\load_db\stel.mdb"
appAccess.OpenCurrentDatabase db_path
appAccess.DoCmd.TransferText 1, "spec1", "tbl1", "c:\stel\stel.txt", True
 
That is because you have the [HasFieldNames] parameter equal to True. Set it to false if you do not have a header record. That should work.

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top