B
bsmith1111
Hello. I'm trying to import about 15 columns from a tab-delimited text
file with about 250 columns and around 10,000 records (I need it
automated as I do it on a regular basis). I've spent the last few days
trying everything I can think of....here's what I've got so far.
1) Use an excel macro to import the whole thing and delete unneeded
columns. Unfortunately I could not get the macro to work with so many
columns because the line of code would be too long (I also tried a
second time by "skipping" the unneeded columns in the import- still did
not work)
2) Import the text file using the information in the help file. I went
ahead and created the table "Mainata" and put the columns I wanted in
there. I didn't think it would work, and I was right.
Here was my line of code:
DoCmd.TransferText acImportDelim, "Mainata", "c:\Documents and
Settings\All Users\Documents\Main\MainData.txt", -1
3) Somehow use a schema.ini file that is automatically created (got
this from http://www.devx.com/tips/Tip/12566 ) in conjunction with
Access directly. I think this is the thing that would really work. I've
already gotten the schema file for the entire file. My theory is that I
could edit the automatically created schema.ini file by taking out the
unneeded columns and somehow incorporate that into some of my visual
basic code, but I can not find much information on this. If this is the
way to go, I think it would be the best to use in the short and long
runs and also the fastest.
Thank you for your time.
B. Smith
file with about 250 columns and around 10,000 records (I need it
automated as I do it on a regular basis). I've spent the last few days
trying everything I can think of....here's what I've got so far.
1) Use an excel macro to import the whole thing and delete unneeded
columns. Unfortunately I could not get the macro to work with so many
columns because the line of code would be too long (I also tried a
second time by "skipping" the unneeded columns in the import- still did
not work)
2) Import the text file using the information in the help file. I went
ahead and created the table "Mainata" and put the columns I wanted in
there. I didn't think it would work, and I was right.
Here was my line of code:
DoCmd.TransferText acImportDelim, "Mainata", "c:\Documents and
Settings\All Users\Documents\Main\MainData.txt", -1
3) Somehow use a schema.ini file that is automatically created (got
this from http://www.devx.com/tips/Tip/12566 ) in conjunction with
Access directly. I think this is the thing that would really work. I've
already gotten the schema file for the entire file. My theory is that I
could edit the automatically created schema.ini file by taking out the
unneeded columns and somehow incorporate that into some of my visual
basic code, but I can not find much information on this. If this is the
way to go, I think it would be the best to use in the short and long
runs and also the fastest.
Thank you for your time.
B. Smith