webForumDet fria alternativet

Hämtar inte all text i PM-fält

ASP

2 svar · 225 visningar · startad av Skarre

Medlem sedan apr. 20012 427 inlägg
Frågan#1

Av någon anledning hämtas inte all text i ett PM-fält (Access) utan texten klipps av mitt i. Jag har aldrig tidigare råkat ut för detta.

Den relevanta koden:

sql = 	"SELECT DISTINCT gallerycategories.* " &_
		"FROM gallerycategories " &_
		"WHERE categoryid IN (SELECT categoryid FROM galleries WHERE galleryid IN (SELECT galleryid FROM gallerypics))"

Set conn = OpenConn()
Set categories = conn.Execute(sql)

If Not categories.EOF Then
	%>
	<table width="100%" border="0" cellspacing="0" cellpadding="3">
	<%
	Do Until categories.EOF
		desc = categories("description")
		%>
		<tr>
			<td>
				<strong><%=categories("name")%></strong>
				<%
				If Len(desc) > 0 Then
					Response.Write "<br>" & desc
				End If
				%>
Medlem sedan juni 20022 599 inlägg
#2

There are limitations in what you can do with queries with memo fields.
Some good KB articles with info, but basically if anything in the query
needs looking within the memo field itself, then it will only look at ( and
return ) the first 256 or so characters. The SELECT DISTINCT is just such a
case. Lose the DISTINCT and it will probably work.

Källa

Medlem sedan apr. 20012 427 inlägg
#3

Tack för den! Det var ju enkelt åtgärdat genom att köra DISTINCT på sub-queryn istället. :)

253 ms totalt · 4 externa anrop · v20260731065814-full.a51de22e
121 ms — deklarationer (db)
0 ms — hämta statistik (cache)
124 ms — hämta tråd, inlägg och bilagor (db)
127 ms — ändringar (db)