Full string not returned on RS.open command

Access 2013, desktop
A query called queryname returns the value of the field Cri6Comment among others.

When I run the query by itself  - it returns the full length of Cri6Comment - so far so good.
Cri6Comment has about say 1000 characters

When i do the following
dim string1 as string
rs.open "Select * from queryname ", currentproject.connection, adopenstatic  adlockreadonly
debug.print rs!Cri6Comment \

The value is it is truncated ( suspect to 255 chars)  

When I do
String1 = rs!cri6comment

String1 is truncated from what should be the true value of Cri6Comment.

Why is the query truncating my field?  

Cri6comment is Long Test
LVL 4
Keyboard CowboyAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
what is the SQL statement of the query "queryName"?

are you using aggregate function in the query?

try opening the table as recordset and see if the field will be truncated to 255

dim string1 as string
 rs.open "Select * from TABLEname ", currentproject.connection, adopenstatic  adlockreadonly
 debug.print rs!Cri6Comment
0
 
COACHMAN99Commented:
is there a line feed in the original text.
0
 
Keyboard CowboyAuthor Commented:
I don't think so.  It happens on several fields and they all display properly in a form
cri6comment is just one of them.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
crystal (strive4peace) - Microsoft MVP, AccessConnect With a Mentor Remote Training and ProgrammingCommented:
try using DAO instead of ADO
0
 
aikimarkConnect With a Mentor Commented:
You might need to invoke the getchunk method on such fields.

reference: https://msdn.microsoft.com/en-us/library/ms681747(v=vs.85).aspx
0
 
Keyboard CowboyAuthor Commented:
I discovered that the query wasn't returning the full text field.  There are several situtations where a query will truncate a long text field - such as using DISTINCT with a long text field will truncate it to 255 chars).  However, none of those applied to me.

I fixed the problem by copying the query from an old backup and it started working.
Whew...
0
 
Keyboard CowboyAuthor Commented:
Thanks everyone -
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.