IMEX parameter

forum.td.development (2005-2010)
Daniele

IMEX parameter

Post by Daniele » 23 Jun 2009, 12:55

 Posted by:  Daniele 

Hi,
I need to get data from an excel sheet; I can't use ActiveX integration
because on the servere running application MS-Office is not installed, so
I'm trying to use ODBC connection.

The problem is that some values in an Excel column may be returned as Null
when the underlying value is not a Null. This typically occurs when numeric
and text datatypes are intermixed within the same Excel column.

To avoid this I need to add the option IMEX=1; to the Excel connect string
in the OpenDatabase method.

Is there anyone who knows how could I set it ?

Thanks
Daniele

Krzysztof Dorko

IMEX parameter

Post by Krzysztof Dorko » 23 Jun 2009, 15:08

 Posted by:  Krzysztof Dorko 

Hi
In many ways
1 gupta ini - just add parameter to connection string - heavy to maintenance
(I think) since you can easily delete gupta file and forgot to add it again
2 Create dsn type of file and setup sql.ini to read from this file.
[odbcrtr]
remotedbname=YourDSNName,filedsn=c:\file.dsn
3 Using oledb (i.e.SqlUDL var.)
4 Using ADO (Microsoft ActiveX)
5 If you can force users to save Excel file in form of XML you can read and
write to it without any oledeb/odbc drivers + you even do not need to have
any Excel installed on the client machine you can create Excel type of XML
in StarOffice or something like this.
Having this Star office on your terminal server can give your users
possibility to create/update excel sheets on it instead of transferring them
from client's machines.

HTH
Kris

Daniele

IMEX parameter

Post by Daniele » 23 Jun 2009, 16:41

 Posted by:  Daniele 

Thanks Krzysztof,
I've create a dsn type of file and setup sql.ini to read from this file, but
I don't know where to insert the IMEX=1 parameter.

Do you have any suggestion ?

Thanks again
Daniele

Krzysztof Dorko

IMEX parameter

Post by Krzysztof Dorko » 23 Jun 2009, 16:58

 Posted by:  Krzysztof Dorko 

dsn file can look like
[ODBC]
DRIVER=Microsoft Excel Driver (*.xls)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
ReadOnly=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=excel 8.0
DriverId=790
IMEX=1
DefaultDir=C:
DBQ=C:\debts11.xls

this imex param is just the next param.

Kris

Return to “td.development”

Who is online

Users browsing this forum: [Ccbot] and 0 guests