?
Solved

Getting a Type Conversion Failure when importing a large number of records into an access table every 2048 rows

Posted on 2009-04-13
10
Medium Priority
?
398 Views
Last Modified: 2013-11-29
I am successfully importing approximately 15,000 records from a text file into Access using the Get external data wizard.  However, even though my text file has no errors, every 2048 rows beginning on row 2049, I am getting the Type Conversion Failure in several fields of the table for that row.  It seems to be using the first character from the 2049th row for something in the 2048th record because the data in the 2049th row is off by one character which seems to be causing the error.  This problem repeats itself again at rows 4097, 6145, 8193,  10241, 12289 and again in 14337.  I assume there is some issue surrounding a bug in the software and a limitation around 2048 records.  Can anyone help me with setting a buffer in Access or something that will solve this problem?
0
Comment
Question by:evel1959
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 18

Expert Comment

by:jmoss111
ID: 24134063
Where does the text file come from? What size are the rows? It sounds like the problem is not in Access but in whatever creates the text file.
0
 
LVL 18

Expert Comment

by:jmoss111
ID: 24134071
Could you post a sample file?
0
 

Author Comment

by:evel1959
ID: 24134305
The data is Phone records originally in ascii format.  I use the copy *.txt inall.txt dos command to concatenate a bunch of files, then I remove the extra CR LF characters to get the resulting file.  I then upload it into Access and get the problem.  The size of each individual record is 627 bytes, I upload it to an existing table using an import spec.
combinedwk6.txt
0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
LVL 18

Expert Comment

by:jmoss111
ID: 24134500
The first thing that I would do is import into a table with all text columns which will resolve your type conversion failure. I always import into all text columns in a staging table abd never into a production table.

Where does the first column in the text file come from, is it an id column from a table where your text export file comes from?
0
 
LVL 18

Expert Comment

by:jmoss111
ID: 24134506
I imported 48547 rows with no error
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 1000 total points
ID: 24136423
I imported thed file and observed the same error.

It is the line termination that confuses Access. It is only CR (hex 0D) where it should be CR+LF (hex 0D 0A)

If you replace 0D with 0D 0A, you are all set. Either (preferred) adjust the source or run a replace utility of your choice.

You may also replace the last space (hex 20) and the 0D of each line with 0D 0A. This will keep the file size and is much faster.

/gustav
0
 

Author Comment

by:evel1959
ID: 24138757
I'll look closer at the data to try to get them all imported properly.  Thanks, I'll post back with the result.
0
 

Author Comment

by:evel1959
ID: 24139979
Gustav you are a Genius!  Must be some kind of buffer that gets full unless it sees a LF after the CR.  Thanks so much.  I replaced all my CR with CR LF using Text crawler and all the records import as they are expected to.  Thanks to both of you for helping me get to a resolution.  It was driving my nuts.
0
 

Author Closing Comment

by:evel1959
ID: 31569712
Thanks!
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 24140018
Thanks. Glad you succeeded!

/gustav
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

762 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