Hi,
I have an application that uses the DoCmd.TransferSpreadsheet method to import data from an Excel spreadsheet into an existing table (which is cleared before import) in an Access database.
The Excel sheet has a number of fields that can be up to 500 characters in length, so I need to import them into memo fields in the database. After seeing some issues with the data being truncated, a bit of "Googling" has thrown up the fact that regardless of the field type, Access seemingly does it's own thing and decides on how to process the data when importing it. If the data in the first few rows of the spreadsheet is less that 255 characters, Access imports the field as text for all rows, i.e., truncates the data at 255 characters, even for subsequent rows that are larger.
I can add a column to the spreadsheet and use the Excel Len() function to manually sort the data to have the rows at the beginning contain long text entries before I import it which forces Access to treat them as Memo fields, but this is a regular operation and that would be a pain. I guess that I can probably write some (probably bad) VBA to do this programmatically, but I was wondering if anyone had any better ways of solving this problem please?
regards
Dave
I have an application that uses the DoCmd.TransferSpreadsheet method to import data from an Excel spreadsheet into an existing table (which is cleared before import) in an Access database.
The Excel sheet has a number of fields that can be up to 500 characters in length, so I need to import them into memo fields in the database. After seeing some issues with the data being truncated, a bit of "Googling" has thrown up the fact that regardless of the field type, Access seemingly does it's own thing and decides on how to process the data when importing it. If the data in the first few rows of the spreadsheet is less that 255 characters, Access imports the field as text for all rows, i.e., truncates the data at 255 characters, even for subsequent rows that are larger.
I can add a column to the spreadsheet and use the Excel Len() function to manually sort the data to have the rows at the beginning contain long text entries before I import it which forces Access to treat them as Memo fields, but this is a regular operation and that would be a pain. I guess that I can probably write some (probably bad) VBA to do this programmatically, but I was wondering if anyone had any better ways of solving this problem please?
regards
Dave