Solved

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

Posted on 2000-03-08
7
161 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

785 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