Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Memo field does not output entire contents to asp when called

Status
Not open for further replies.

mrgulic

Technical User
Sep 18, 2001
248
US
I use FCKeditor to send HTML encoded data to a memo field in Access. When I pull the data to view it in all its formatted glory not all the data will display. It would seen that there is a character limitation but I don't know where that would be. From the database table i can see all the text (in HTML) but the web page is not displaying it.

Seems to be a 250 character limitation on the output. The data field in msAccess is set to memo.

I am totally lost. No one here has any idea.

Code:
<!-- #INCLUDE file="includes/adovbs.inc" -->
<!-- #INCLUDE file="includes/db_kb.inc" -->
<!-- #include file="includes/sql_validate.inc" -->
<%
Dim rstTitle, strTitle

Set rstTitle = Server.CreateObject("ADODB.Recordset")

	strID = Request.QueryString("ID")
		
	strTitle = "SELECT DISTINCT tblKnowledgebase.KBID, tblKnowledgebase.txt_KB_Title, tblKnowledgebase.mem_KB_Content," & _
				" tblKnowledgebase.txt_KB_Modified_By, tblKnowledgebase.dt_KB_Modified_Date, tblKnowledgebase.txt_KB_Authored_By," & _
				" tblKnowledgebase.dt_KB_Authored_Date, tblKnowledgebase.txt_KB_Approved_By, tblKnowledgebase.dt_KB_Approved_Date," & _
				" tblKnowledgebase.bln_KB_Approved, tblKnowledgebase.[_SCID], tblSubCatagory.SCID," & _
				" tblSubCatagory.txt_SubCatagory_Title" & _
				" FROM tblSubCatagory RIGHT JOIN tblKnowledgebase ON tblSubCatagory.SCID = tblKnowledgebase.[_SCID]" & _
				" WHERE (((tblKnowledgebase.KBID)= " & strID & "));"
	
	If isValidString(strID) = True Then
		rstTitle.Open strTitle, adoCon
		', adOpenKeyset, adLockPessimistic, adCmdText	
	Else
	   If 1 = 1 Then
			Response.Clear
			Response.Redirect("invalid_characters.asp")
			Response.End
	   End If
	End If
 
%>


<html>
<head>
<title>VIEW Article</title>
</head>

<body>

<table width="98%" cellpadding="2">	 
	<tr>
		<td width=width="80%">
			<a href="default.asp">Categories</a> >  <a href="view_catagory.asp?ID=<%=rstTitle("SCID")%>"><%=rstTitle("txt_SubCatagory_Title")%></a>
		</td>
		<td>
		</td>
		<td valign="center">
			<!--
			<form method="get" action="delete_title.asp" > 
				<input type=button value="Delete Article" onClick="submit">
			</form>
			-->
			<a href="delete_title.asp?ID=<%=rstTitle("KBID")%>">Delete</a>
		</td>	
	</tr>
	<tr><td colspan="3"><hr></td></tr>
	<tr>
		<td bgcolor="#C0C0C0" colspan="3"><b>Title:</b></td>	
		<!--<td><b>ID:</b> <%=rstTitle.Fields("KBID")%></td>-->
	</tr>
	<tr>
		<td colspan="3">
			<%=rstTitle("txt_KB_Title")%>
		</td>
	</tr>
	<tr><td colspan="3"><hr></td></tr>	
	<tr><td colspan="3" bgcolor="#C0C0C0"><b>Content:</b></td></tr>
	<tr>
		<td colspan="3">
		
		[COLOR=#ff0000]<%=rstTitle("mem_KB_Content")%>[/color]
			
		</td>
	</tr>
	<tr><td colspan="3"><hr></td></tr>
	
	<tr>	
		<td width="20%"><b>Modified By:</b> <%=rstTitle("txt_KB_Modified_By")%></td>		
		<td width="20%"><b>Modified Date:</b> <%=rstTitle("dt_KB_Modified_Date")%></td>
		<td></td>			
	</tr>
	<tr>	
		<td width="20%"><b>Authored By:</b> <%=rstTitle("txt_KB_Authored_By")%></td>		
		<td width="20%"><b>Authored Date:</b> <%=rstTitle("dt_KB_Authored_Date")%></td>
		<td></td>
		
	</tr>
	<tr>	
		<td width="20%"><b>Approved By:</b> <%=rstTitle("txt_KB_Approved_By")%></td>		
		<td width="20%"><b>Approved Date:</b> <%=rstTitle("dt_KB_Approved_Date")%></td>

		<td width="10%"><b>Approved:</b> <%=rstTitle("bln_KB_Approved")%></td>
	</tr>
</table> 


<%
rstTitle.Close
Set rstTitle = Nothing
adoCon.Close
Set adoCon = Nothing
%>
</body>
</html>
 
Did you try using "View Source" in the browser to make sure that the data is actually being truncated? It might be some other display issue.
 
No, its being truncated......after 250 characters.

It's bloody maddening.
 
there is a well known bug with memo fields that will leave the recordset empty when you try to use it twice maybe this could be a similar thing.

some things to try;

Pass the problem field to a variable before displaying it.

Use getRows() to bring the data back in an array.

See what character the data "breaks" at and replace it, in case that is a problem.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
I found the answer on the Code Gurus FOrum and thought I would share:

"Apparently, it (SQL) will automatically truncate MEMO fields if your query has a DISTINCT or a GROUP BY in it."

My query did not require DISTINCT as it was simply a leftover from a previous query that I copied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top