DBColAttribute SQL_VARCHAR

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DBColAttribute SQL_VARCHAR

Günther Schmidt
Hi all,

thanks to Chris Uppal I managed to access an Excel via ODBC dsn-less.

Now when I iterate over the result I keep getting "index out of bounds"
exceptions.

It seems that the ODBC interface comunicates to Dolphin that a column
has an SQL type of SQL_VARCHAR (255) while it in fact is not.

Is there a way to "fix" this?

This may only occur with Excel data sources that have a lot of text in
their columns.

Günther


Reply | Threaded
Open this post in threaded view
|

Re: DBColAttribute SQL_VARCHAR

Chris Uppal-3
Günther,

> It seems that the ODBC interface comunicates to Dolphin that a column
> has an SQL type of SQL_VARCHAR (255) while it in fact is not.

I think that whatever is happening here is a problem inside the Excel ODBC
driver, rather than something that's going wrong between Dolphin and the
driver.  You may have some luck with Google looking for other people who've hit
the same problem using other languages.

I tried an experiment, and found that the driver could also truncate long text
fields to 255 characters.  Unfortunately (or not), I don't have Excel so I'm
using OpenOffice to create Excel 5.0 format files, and something might be going
wrong there, but -- all in all -- the ODBC link seems a bit iffy...

You may have more luck by either using the ActiveX/COM stuff to talk to Excel
directly (which has been discussed often in this NG before), or by telling
Excel to save the data in CSV form and parsing that directly yourself.

    -- chris