View Single Post
  #5   Report Post  
Posted to comp.lang.java.databases,microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Reading long strings (with jdbc) from Excel

(Aaron Fude) wrote ...

Just out of curiosity, in my sql
code, why can't I simply say result.getMemo()?


I put it down to a failed experiment <g.

When querying a text file (e.g. a .csv), I can create a scheme.ini
file and specify the data types for each column. I even get errors
when the data fails to meet the specified formats.

I don't see why this approach could not have been taken for Excel
data. My guess is that MS decided to try a different approach with
Excel for the sake of it. I think all agree the approach taken for
text files is the superior approach (in this.NET age, .ini files are
even coming back into to fashion in preference to registry keys <g).
We were quickly stuck with the Excel approach, presumably in the
interests of MS Office's great track record on forwards- and
backwards-compatibility issues.

There is Jet function that will cast a value as type MEMO: it is
CStr() <g. However, casting is of no use to you because the Excel
column's data type is determined to be TEXT, hence truncated at 255
characters, before it is operated on in the SELECT clause of a query.

Jamie.

--