Use ADO in VB to read excel file problem

G

Guest

Hi all,

I have written a VB program to read the excel file via ADO.
ie :
rs.Open "SELECT * FROM [sheet1$]"

However, I find that if the excel cell contains more that 255 characters,
the recordset cannot retrieve it correctly, it will store the first 255
character and discard the rest.

Is it a ADO Excel provider limitation ?
anyone idea to solve this problem ?

Thanks
 
G

Guest

Hi
A cell can contain up to 256 chrs. If you are reading 255 the VB control you
are using is probally set to o index. Most VB controls can be set to either 0
or 1 as the starting index number.

Goog Luck
TK
 
T

Tom Ogilvy

A cell can contain approximately 32K characters in xl97 and later.

--
Regards,
Tom Ogilvy


TK said:
Hi
A cell can contain up to 256 chrs. If you are reading 255 the VB control you
are using is probally set to o index. Most VB controls can be set to either 0
or 1 as the starting index number.

Goog Luck
TK



ong said:
Hi all,

I have written a VB program to read the excel file via ADO.
ie :
rs.Open "SELECT * FROM [sheet1$]"

However, I find that if the excel cell contains more that 255 characters,
the recordset cannot retrieve it correctly, it will store the first 255
character and discard the rest.

Is it a ADO Excel provider limitation ?
anyone idea to solve this problem ?

Thanks
 
G

Guest

I assumed "ong" was using an older version and was having trouble returning
the last character. I stand corrected or amended.

Good Luck
TK


Tom Ogilvy said:
A cell can contain approximately 32K characters in xl97 and later.

--
Regards,
Tom Ogilvy


TK said:
Hi
A cell can contain up to 256 chrs. If you are reading 255 the VB control you
are using is probally set to o index. Most VB controls can be set to either 0
or 1 as the starting index number.

Goog Luck
TK



ong said:
Hi all,

I have written a VB program to read the excel file via ADO.
ie :
rs.Open "SELECT * FROM [sheet1$]"

However, I find that if the excel cell contains more that 255 characters,
the recordset cannot retrieve it correctly, it will store the first 255
character and discard the rest.

Is it a ADO Excel provider limitation ?
anyone idea to solve this problem ?

Thanks
 
J

Jamie Collins

TK said:
I have written a VB program to read the excel file via ADO.
ie :
rs.Open "SELECT * FROM [sheet1$]"

However, I find that if the excel cell contains more that 255
characters,
the recordset cannot retrieve it correctly, it will store the first 255
character and discard the rest.

Is it a ADO Excel provider limitation ?
anyone idea to solve this problem ?

Sounds like Jet is determining the column's data type as 'text' rather
than 'memo'. For details see:

http://www.dicks-blog.com/excel/2004/06/external_data_m.html

Jamie.

--
 
R

Robin Hammond

While the 255 limit is up for discussion, why is there still a limt of 255
characters when copying a sheet?

I found this today in XP and just tried it in 2003 and am somewhat surprised
given that the character limit has gone up over the years to find that I
can't copy a sheet without losing data. I've got an easy workaround, but
surely this is a legacy they should have been fixed?

Robin Hammond
www.enhanceddatasystems.com


Jamie Collins said:
TK said:
I have written a VB program to read the excel file via ADO.
ie :
rs.Open "SELECT * FROM [sheet1$]"

However, I find that if the excel cell contains more that 255
characters,
the recordset cannot retrieve it correctly, it will store the first 255
character and discard the rest.

Is it a ADO Excel provider limitation ?
anyone idea to solve this problem ?

Sounds like Jet is determining the column's data type as 'text' rather
than 'memo'. For details see:

http://www.dicks-blog.com/excel/2004/06/external_data_m.html

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top