Connecting to Excel via ODBC

General discussion forum about all databases other than SqlBase.
firstbase107

Connecting to Excel via ODBC

Post by firstbase107 » 09 Apr 2010, 13:39

Hello!

I encounter an interesting behaviour, when I try to connect to Excel via ODBC:

In my repro-case, I simply try to get connects as with any other ODBC-DataSource.
The Excel is defined in the sql.ini (not as a DSN in Windows) as:
remotedbname=FMEXCEL,DRIVER={Microsoft Excel Driver (*.xls)};DBQ=fm_excel.xls;DefaultDir=C:\temp\log;ReadOnly=;
(see the sql.ini in the attached sample)

When I try to connect with SqlConnect in a functional class, the "When SqlError" - defined right before the SqlConnect - is ALWAYS entered, throws the ErrorCode "20048", and then ignored the "Return FALSE" (which should be the returnvalue of the SqlConnect).
The Handle then gets a valid value, and can even deliver the correct brand of the connection.
Even a following SqlPrepareAndExecute goes into the corresponding "When SqlError" with the ErrorCode "20035" ...

Seems like a bug to me ...
Please take a look an confirm, or at least give a workaround as we NEED to connect to Excel that way!

Cheers,
Alex
You do not have the required permissions to view the files attached to this post.

herve

Re: Connecting to Excel via ODBC

Post by herve » 14 Apr 2010, 15:00

Hello,

Which version of office are you using ?
Did you try to connect with oledb ?

Regards

Hervé

firstbase107

Re: Connecting to Excel via ODBC

Post by firstbase107 » 19 Apr 2010, 08:38

Hi Herve,

I'm using "Office 2003", no try with OLEDB so far.

Cheers,
Alex

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests