ADO and Large Varchar truncated to 255 chars

T

Tim

Hi there,

I am trying to retrieve data from an SQL Server 2000 db. The data is
Varchar(4000). Using the following VBA the data gets truncated to 255 chars.
How do I get data from large Varchar fields using ADO?

Many thanks

Tim


Do Until rs.EOF
i = 0
For Each f In rs.Fields
Debug.Print f.Value, Len(f.Value)
.ActiveCell.Offset(lRow + 1, i) = f.Value
i = i + 1
Next f
lRow = lRow + 1
rs.MoveNext
Loop
 
S

Stefan Hoffmann

hi Tim,

Tim write:
I am trying to retrieve data from an SQL Server 2000 db. The data is
Varchar(4000). Using the following VBA the data gets truncated to 255 chars.
How do I get data from large Varchar fields using ADO?
Post the SQL statement used for opening rs.
Debug.Print f.Value, Len(f.Value)
What does f.Type return?


mfG
--> stefan <--
 
D

Douglas J. Steele

This newsgroup is for questions about Access, the database product that's
part of Office Professional. It looks as though you're using Excel, so you
might want to as in a newsgroup related to Excel.

When you do repost, it would probably help the responder to know what
version of Excel you're using, since different versions have different
limitations on how much data can be put into a single cell.
 
E

Ed Adamthwaite

Hi Tim,
if you are using an aggregate query string (using Group By) then the string
fields will be truncated to 255 characters. Use a simple select query
instead.
Regards,
Ed.
 

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