Truncate a value from Excel cell!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

This is a rather weird question, but I thought Access users muct have a bit
more experience in SQL statements.

I connect to an excel workbook using OLEDB and use a simple select statement
to get all rows in a sheet. But sometimes I get an error!!

Microsoft JET Database Engine error '80040e57'

The field is too small to accept the amount of data you attempted to add.
Try inserting or pasting less data.

I recon that some cells have too much data to fit in the recordset!!!!!
I know that because if I try the first few rows only, it works!!

Substring doesn't seem to work (Substring(Value, 1, 50) for example) with
this as it would on SQL server...

Any hints here?? I can use your help.

Thanks.
 
Einy said:
Hi there,

This is a rather weird question, but I thought Access users muct have a bit
more experience in SQL statements.

I connect to an excel workbook using OLEDB and use a simple select statement
to get all rows in a sheet. But sometimes I get an error!!

Microsoft JET Database Engine error '80040e57'

The field is too small to accept the amount of data you attempted to add.
Try inserting or pasting less data.

I recon that some cells have too much data to fit in the recordset!!!!!
I know that because if I try the first few rows only, it works!!

Substring doesn't seem to work (Substring(Value, 1, 50) for example) with
this as it would on SQL server...

Any hints here?? I can use your help.

Thanks.

You could try
Mid(ValueField, 1, 50)
or
Left(ValueField, 50)

or, change the size of the necessary field in the database.
 
Back
Top