• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

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?
0
SSF
Asked:
SSF
1 Solution
 
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
 
SSFAuthor Commented:
thanks!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now