evel1959
asked on
Getting a Type Conversion Failure when importing a large number of records into an access table every 2048 rows
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?
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.
Could you post a sample file?
ASKER
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
combinedwk6.txt
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?
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?
I imported 48547 rows with no error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'll look closer at the data to try to get them all imported properly. Thanks, I'll post back with the result.
ASKER
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.
ASKER
Thanks!
Thanks. Glad you succeeded!
/gustav
/gustav