473,770 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select query truncates memo field

Hi all,

I have a query in ASP.NET that selects text from a memo field in Access
(among other things). The query appears to be truncating the text at
255 characters. I've done a little research on this and found some
other Google Groups threads that were helpful, but I still don't have a
solution. My query is rather complicated and uses a union, but not the
keyword distinct. The query is displayed in a datagrid, and I don't
know how I would be able to break it up to solve the 255 problem and
still have it display in the one datagrid. Is there anything I can add
to it? Here's the query:

(Select pk_characterist ic_id, vc_characterist ic_name,
pk_description_ id, tx_description From ((tb_descriptio ns d inner join
tb_agents a on d.fk_agent_id = a.pk_agent_id) inner join
tb_characterist ics c on d.fk_characteri stic_id =
c.pk_characteri stic_id) where d.fk_agent_id = @agentID) UNION (select
pk_characterist ic_id, vc_characterist ic_name, 0 AS pk_description_ id,
'' from tb_characterist ics where pk_characterist ic_id NOT IN (select
fk_characterist ic_id from tb_descriptions where fk_agent_id =
@agentID))

Is there a solution to my problem, or am I going to have to switch
databases? Please help!

Thanks!
Anna

Nov 13 '05 #1
4 4103
Anna,
I don't see a Group By in your query, but this error is usually because
access can't Goup By memo fields. Is it possible you are Gouping
somthing further down the line? Since you are using access as a
backend, rather than fail, Access kindly converts the memo to text(255)
and runs the qry. You have probably done this, but sometimes opening
up Access and pasting the sql into a qry will give you error messages
that you didn't get using it as a backend - to help you troubleshoot.
HTH
Pachydermitis

Nov 13 '05 #2
Thanks for the quick reply. Unfortunately, running the query in Access
doesn't produce any errors, and it truncates the memo fields just like
it does in the code. Is this a bug in Access?

Thanks,
Anna

Nov 13 '05 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your query looks like an SQL Server syntax - you have the parameter
@agentID. Access queries do not use parameters like that. In the
second UNION you have a place holder of '' for the tx_description
column. I believe this is the culprit - it is indicating that the data
type of that place holder is a VARCHAR, which, for some reason, is
truncating to 255 chars. If your data back-end really is SQL Server you
might try CAST('' to TEXT) which will set the data type to TEXT (Memo in
SQL Server).

Did you test each query in the UNION query, one at a time, to see if
they both return the correct data? IOW, if the top query returns the
TEXT/Memo data correctly, but adding the bottom query truncates the
data, then you know the bottom query is the culprit.
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQla88IechKq OuFEgEQK7nwCfav BByOKu7HCNkafi7 ctDJTF3B9oAnjCk
YntwDg5QPrN0HqL T3RLGbYPp
=tC12
-----END PGP SIGNATURE-----

Anna wrote:
Hi all,

I have a query in ASP.NET that selects text from a memo field in Access
(among other things). The query appears to be truncating the text at
255 characters. I've done a little research on this and found some
other Google Groups threads that were helpful, but I still don't have a
solution. My query is rather complicated and uses a union, but not the
keyword distinct. The query is displayed in a datagrid, and I don't
know how I would be able to break it up to solve the 255 problem and
still have it display in the one datagrid. Is there anything I can add
to it? Here's the query:

(Select pk_characterist ic_id, vc_characterist ic_name,
pk_description_ id, tx_description From ((tb_descriptio ns d inner join
tb_agents a on d.fk_agent_id = a.pk_agent_id) inner join
tb_characterist ics c on d.fk_characteri stic_id =
c.pk_characteri stic_id) where d.fk_agent_id = @agentID) UNION (select
pk_characterist ic_id, vc_characterist ic_name, 0 AS pk_description_ id,
'' from tb_characterist ics where pk_characterist ic_id NOT IN (select
fk_characterist ic_id from tb_descriptions where fk_agent_id =
@agentID))

Is there a solution to my problem, or am I going to have to switch
databases? Please help!

Nov 13 '05 #4
Thank you - the problem was the union. By the way, I am using Access as
the backend - the "@agentID" is just .NET's syntax for passing in the
variable. Anyways, once I realized the problem was the union I was able
to do a little more research and came across this:

http://groups-beta.google.com/group/...2837e03849daa4

All I had to do was change "union" to "union all" - a nice simple
solution, the way I like it!

Thanks,
Anna

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10214
by: GorDon | last post by:
Hi, I have a report based on a query. The query grabs a memo field from my main table, yet when I display the memo field in the report it truncates the memo field (the field needs to hold more than 255 characters). The table holds all the memo text, but the query seems to truncate the memo field to 255 chars? This seems like there should be a relatively easy fix, but I can't seem to find it.
8
8213
by: skinnybloke | last post by:
Hi - I have a problem with a memo field being truncated to about 255 characters when running a Access 2002 query. This only seems to happen if I use SELECT DISTINCT. It works ok using SELECT by itself. does anyone know why this happens and how to stop it?
2
5232
by: Bob Dydd | last post by:
Hi Everybody I have a Listbox that has a Memo field attached to it's 2nd column which on double click copies the memo field to another Memo Field. Forms!! = ListClassification.Column(1) My problem is that the receiving Memo Field Truncates at 255 characters
3
1995
by: shripaldalal | last post by:
hi all, i have the following fields.... Document_Name, Document_No, Document_Date, Order_No, Order_Date, Peripheral The first 5 you can understand, peripheral is a memo field which contains all less important (but important!) details like Address1, Address2, Place_Of_Delivery in a comma delimited string such as:
2
3594
by: jacoballen | last post by:
I have a query that combines the results of three related tables. The memo fields are truncated to 255 characters, but I need all the information in them. I'm aware that removing code such as DISTINCT and GROUPBY will fix this problem (as discussed in other threads in this group), but I need to limit the query results to unique values, which is what DISTINCT does for me. Any suggestions? Thanks, Jacob
2
1807
by: Keith Wilby | last post by:
I have a table containing different field types including a memo field. If I do a select distinct on the table the memo field is truncated to 256 characters. I've never encountered this before, is it a known issue? Thanks. Keith.
2
5375
by: Genalube | last post by:
I am running a query that includes the inclusion of memo fields, my query pulls from four different tables with one to many relationships between them. The relationships are such that when I run my query I get several identical records. I thought I could just put the DISTINCT keyword in and solve this problem. It does but the 255 character limitation that crops up with memo fields, rears its head and cuts out large chunks of the memo field....
2
2279
by: cherylwalsh35 | last post by:
I am working in access - using a select Query. I am including a memo field. The table has all of the data in the memo field displayed - however when I run a select query and include the memo field - the data is truncated. Any ideas?
5
10303
Shakss2
by: Shakss2 | last post by:
Hi... I am exporting some data from a table with a memo field to excel but the excel report truncates the memo field data to 255 chars. Dim strPath As String ' Current path strPath = CurrentProject.Path & "\Adhoc_Report.xls" 'New workbook object Dim sh As Workbook DoCmd.OutputTo acOutputTable, "test2", acSpreadsheetTypeExcel9, strPath, 1 'Setting obj
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.