DAO/ADO Returning Null on Excel File Integers

DAO/ADO Returning Null on Excel File Integers

Anonymous
Not applicable
254 Views
2 Replies
Message 1 of 3

DAO/ADO Returning Null on Excel File Integers

Anonymous
Not applicable
I'm finding that if I connect to a XLS file with DAO or ADO that
certain cells will return null when it should contain an integer.
I've tried formatting the cells as text in Excel but that don't help.
The null shows up as a variant in the fetched data collection even
before I attempt to assign it to a variable.

What does help is prefixing each integer with an ' in Excel. But
thats obviously not a practical thing to do.

Anyone ever run across this?

Thanks in advance.

Terry
0 Likes
255 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I haven't seen that, but I haven't done much Excel work.

ADO and DAO ignore any data type format assignments in Excel. The first
8 rows are scanned to try to figure out the data type. This can cause
problems.

<> has
lots of useful information.

--
jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services

In article <3E6E4D3C.E51FC2AD@dotsoft.com>, Terry W. Dotson wrote:
> I'm finding that if I connect to a XLS file with DAO or ADO that
> certain cells will return null when it should contain an integer.
> I've tried formatting the cells as text in Excel but that don't help.
> The null shows up as a variant in the fetched data collection even
> before I attempt to assign it to a variable.
>
> What does help is prefixing each integer with an ' in Excel. But
> thats obviously not a practical thing to do.
>
> Anyone ever run across this?
>
> Thanks in advance.
>
> Terry
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Jon Fleming wrote:

> ADO and DAO ignore any data type format assignments in Excel. The first
> 8 rows are scanned to try to figure out the data type. This can cause
> problems.
>
> <> has
> lots of useful information.

Thanks for the pointer, as per this topic (referenced in the above)
...

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q194124

... adding IMEX=1; to the connect string solved the problem, since
luckily I have a read only need.

Thanks again!

Terry
0 Likes