Solved

Append text to access using ITC and TransferText- end of line not recognized

Posted on 2000-03-08
7
162 Views
Last Modified: 2010-05-02
I am attempting to append data from an ftp server to my access database.  I am using the internet transfer control to retrieve a text file from the ftp server to a local directory. The text file contains no headers and I am trying to append it to an access table using the transferText command.  

the file downloads fine and i can open it using excel or notepad however when i try to import it to access (either manually or using VB) the end of line characters are ignored and access tries to import the contents of the entire file as a single field.

The ftp server is in a unix box and i am downloading the file to a NT machine.  could it be that the text file is in the wrong format?   Is the TransferText command the best way to append this text file to my table?

If anybody can point me in the right direction I'd really appreciate it (plus you get 100 points!)   :)
0
Comment
Question by:mberumen
  • 5
  • 2
7 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 2599123
Unix text files use a vbCr ( Chr(13) )character as the end of line, while Windows uses the vbCrLf ( Chr(13) + Chr(10) ) character sequence.

You may have to replace the vbCr with vbCrLf in order to import it correctly.
0
 
LVL 4

Author Comment

by:mberumen
ID: 2601713
I'm aware that would work however during a day i need to download and append 960 text files (20 files every half hour).  I am looking for a solution that won't require file manipulation... is it doable?
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2601786
This is all I could find, sorry:

"ACC: Text Import Wizard Doesn't Import Data Correctly"
http://support.microsoft.com/support/kb/articles/Q149/9/46.asp
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Expert Comment

by:Erick37
ID: 2601820
The fastest way is to do the replace during the GetChunk method, when you recieve a chunk of text during the download.

You can then use the Replace function (VB6).  Be careful not to relpace if there is a vbCrLf already in the string.
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 100 total points
ID: 2601828
Oh, and one last thing.
I originally stated that Unix used Chr(13), when in fact it uses Chr(10) as the LineFeed character.
0
 
LVL 4

Author Comment

by:mberumen
ID: 2601847
erick37

I was trying to avoid that but I guess I don't have a choice.....

I hope you don't mind that I reduced the points awarded...   thanks
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2601908
No problem.
Thanks for the "A"
Good Luck.
:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question