dbTalk Databases Forums  

TransferSpreadsheet and Missing Data

comp.database.ms-access comp.database.ms-access


Discuss TransferSpreadsheet and Missing Data in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Shaw
 
Posts: n/a

Default TransferSpreadsheet and Missing Data - 02-28-2004 , 01:54 PM






Hello,

I use TransferSpreadsheet to import an Excel file containing about
9,000 records. The destination table is truncated and the I use the
code below to import the new (current) records.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8,
"Mob_Roster", cData_Source_Folder & "MobRoster.xls", True

I noticed that the SSN field in about 3,000 records came in NULL
instead of with the values from the Excel file. Since I use the SSN
to join those records, this is a big problem. And my confidence in
TransferSpreadsheet is shattered.

It seems like the same records are affected each time and they aren't
in any particular order. I pasted on of the SSN values into its
Access record to see if there was a data type issue, but it accepted
the value.

Any suggestions? Thanks

John

Reply With Quote
  #2  
Old   
Ray
 
Posts: n/a

Default Re: TransferSpreadsheet and Missing Data - 03-01-2004 , 05:47 AM






jmshaw (AT) weir (DOT) net (John Shaw) wrote in message news:<91422298.0402281154.654da652 (AT) posting (DOT) google.com>...
Quote:
Hello,

I use TransferSpreadsheet to import an Excel file containing about
9,000 records. The destination table is truncated and the I use the
code below to import the new (current) records.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8,
"Mob_Roster", cData_Source_Folder & "MobRoster.xls", True

I noticed that the SSN field in about 3,000 records came in NULL
instead of with the values from the Excel file. Since I use the SSN
to join those records, this is a big problem. And my confidence in
TransferSpreadsheet is shattered.

It seems like the same records are affected each time and they aren't
in any particular order. I pasted on of the SSN values into its
Access record to see if there was a data type issue, but it accepted
the value.

Any suggestions? Thanks

John
Hello John.

Sometimes things can be a bit sticky importing in an Excel
spreadsheet. Perhaps this is something you can do, which
is what I do as standard practice.

First, I open the spread sheet and do a "Save As" with it
and save it as a tab delimited text file. Then I import it.

When using the tab delimited setup you shouldn't have the
same type of problem. Access likes to change the field data
type depending on what the data is in the first few rows of
the file. If the data in the first rows is in numeric format,
then access makes the field a double, as an example. If there
are any letters in the field, such as your SSN field, then
data is lost in the import.

Good luck.

Regards,

Ray


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.