?
Solved

Full string not returned on RS.open command

Posted on 2016-10-20
7
Medium Priority
?
41 Views
Last Modified: 2016-10-21
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
0
Comment
Question by:Keyboard Cowboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41852919
is there a line feed in the original text.
0
 

Author Comment

by:Keyboard Cowboy
ID: 41852932
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
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 41852947
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 500 total points
ID: 41853268
try using DAO instead of ADO
0
 
LVL 46

Assisted Solution

by:aikimark
aikimark earned 500 total points
ID: 41853967
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
 

Author Comment

by:Keyboard Cowboy
ID: 41853989
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
 

Author Closing Comment

by:Keyboard Cowboy
ID: 41853991
Thanks everyone -
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question