Solved

Full string not returned on RS.open command

Posted on 2016-10-20
7
27 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
7 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
Comment Utility
is there a line feed in the original text.
0
 

Author Comment

by:Keyboard Cowboy
Comment Utility
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 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 18

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 125 total points
Comment Utility
try using DAO instead of ADO
0
 
LVL 45

Assisted Solution

by:aikimark
aikimark earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks everyone -
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now