TransferText in Access

I'm trying to import a delimited text file into a table in Access. I'm running the code
.
.
.
Text1.LinkTimeout = 10
Text1.LinkTopic = "MSACCESS|" & strPath
Text1.LinkItem = "All"
Text1.LinkMode = 2

cmdstr = "[TransferText 'Import Delimited', 'RGCNSEQ2 Import Specification', 'RGCNSEQ2','u:\access\usa\usa_down\rgcnseq2.txt']"
.
.
.

I get a message "foreign application will not perform dde method or operation". what's wrong?
SSFAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AnswerTheManCommented:
suppose the dB contain a Table named tblTextFile which have 3 fields named :
fldA,fldB,fldC which are all Text.

1. open the dB
2. Open the Table using a Recordset say MyRec
3. open the text file
4. start a loop until the file is EOF
5. read one line into variabels, say 3
   variabels named: strA,strB,strC
6. MyRec.AddNew
7. MyRec.Fileds("fldA")=strA
   MyRec.Fileds("fldB")=strB
   MyRec.Fileds("fldC")=strC
8. MyRec.Update
9.Close the loop
10.close the file
11.close the Recordset
12.close the dB



   
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SSFAuthor Commented:
thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.