Error while importing text file;

G

Guest

i run the following command:
DoCmd.TransferText acImportDelim, , "TempTable", Me.txtFileName, False

Me.txtFileName = New Raw Data.txt
TempTable is already created and all the fields (F1 - F44) are type double

i dont get any run time error when running the import code but after import
the followingtwo tables are created: New Raw Data_ImportErrors, Name
AutoCorrect Save Failures. below are the contents of these tables

the value field is not in the table... i traced the row,column to get the
value from the txt file... the three cells in the temptable are blank/null

New Raw Data_ImportErrors
Error Field Row VALUE
Type Conversion Failure F43 106 = 7926580275
Type Conversion Failure F28 726 = 2543224500
Type Conversion Failure F34 1924 = 6025667800

Name AutoCorrect Save Failures
Object Name Object Type Failure Reason Time
TempTable Table Could not save the object 5/17/2007 4:30:40 PM

can anyone help me understand why i am getting theseand what do i need to do
to fix this.

Thanks
 
G

Guest

Are you double sure that they aren't Long Integer number fields? Longs can
only hold only values from -2,147,483,648 to 2,147,483,647 which is smaller
than the numbers that errored out. A Double number field holds more.

You might want to create an import specification and save it. Their you can
explicity say to import the numbers as doubles. Try importing the file
manually and look for the Advanced button on the lower left of the Import
Text Wizard dialog box. Create an import spec and save it. Put the name of it
in your code between the two commas after acImportDelim. Something like:

DoCmd.TransferText acImportDelim, "ImpText", "TempTable", Me.txtFileName,
False

If that doesn't work, you could always put the data into a Currency or even
Text field.

As far as Name AutoCorrect errors, go to Tools, Options, General Tab and
turn off Name Autocorrect on all of your databases. IMHO it's a piece of
do-do and the cause of many problems. While there turn off Compact on Close
if enabled. You'll be glad that you did.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top