Forum Moderators: open

Message Too Old, No Replies

values from recordset with memo type cut off

         

jnoody

6:14 pm on Jun 9, 2004 (gmt 0)

10+ Year Member



I am using a select statement to get data from an .mdb and one of the values I get from a memo type field is cut off. Here is sample code and results:

<%
dim productsSQL
dim products
dim manufacturerID
dim productName
dim whyGreen
dim count

productsSQL = "select distinct `ManufacturerID`, `ProductName`, `WhyGreen` from `Products` where `ManufacturerID` is not null;"
Set products = OpenRecordset(productsSQL)
while not products.eof
manufacturerID = products("ManufacturerID")
productName = products("ProductName")
whyGreen = products("WhyGreen")
Response.write("<div class=""product_title""><b>Product Name</b>: " & productName & "<br><br><b>Why Green</b>: " & whyGreen & "</div><br><br>")
products.movenext
wend

The WhyGreen field is a memo data type. What is printed out for that field in one sample entry is "Holes in the foundation of a house can affect indoor air quality. Radon, an odorless, tasteless, naturally-occuring gas produced by the breakdown of uranium in the soil can enter a house through openings in the foundation such as the sump pit. A sealed", but by looking directly in the table there is a lot more text stored there. I know you can have problems if you are trying to insert too much data into a smaller sized field, but what would cause data that is already stored in the table to not be entirely extracted?

Thanks in advance

john_k

6:55 pm on Jun 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The text you supplied is 252 characters long. If any of those spaces were in fact carriage returns (ascii 13 + ascii 10), then you are likely looking at some type of 255 or 256 character limit that is being imposed somehow.

What happens if you just run the query right in Access?

Also, search this forum as this and similar issues have been discussed before.

One last thing - Since you are bringing back multiple records with this query, do you really need the full memo field?

duckhunter

7:49 pm on Jun 9, 2004 (gmt 0)

10+ Year Member



Try using the GetChunk() method

jnoody

1:48 am on Jun 10, 2004 (gmt 0)

10+ Year Member



I haven't been able to find this problem anywhere on the forum in regard to retrieving data.

How do I use the getChunk method? If I use a large number as the argument, instead of printing the whole string, it just repeats the same truncated version of the string.

duckhunter

3:00 am on Jun 10, 2004 (gmt 0)

10+ Year Member



[msdn.microsoft.com ]

Const conChunkSize = 100
lngTextSize = RS!Field.ActualSize

Do While lngOffset < lngTextSize
varChunk = RS!Field.GetChunk(conChunkSize)
varText = varText & varChunk
lngOffset = lngOffset + conChunkSize
Loop