[thelist] GetRows goofiness (or my own)

Canfield, Joel JCanfield at PacAdvantage.org
Mon Oct 2 12:47:59 CDT 2006


I have a query which in MSSQL's query analyzer returns exactly the
results I expect. I have an ASP page on our intranet where run the
query, then use GetRows on the results set.

Can anyone see why, no matter what I do, item 4 (the one numbered '4,i',
not the fourth item) in this is blank, every time for every query?

With Response
	.Write("<tr class=""small"">" & vbCrLf & vbCrLf)
	.Write("<td>" & aryExactResultsList(0,i) & "</td>" & vbCrLf)
	.Write("<td>" & aryExactResultsList(1,i) & "</td>" & vbCrLf)
	.Write("<td>" & aryExactResultsList(2,i) & "</td>" & vbCrLf)
	.Write("<td>" & aryExactResultsList(3,i) & "</td>" & vbCrLf)
	.Write("<td>" & aryExactResultsList(4,i) & "</td>" & vbCrLf)
	.Write("<td>" & aryExactResultsList(5,i) & "</td>" & vbCrLf)
	.Write("</tr>" & vbCrLf & vbCrLf)
End With

++++++++++++++++++

Here's the full section of code in all its glory:

strQuery = "select WO_NUM, REQDATE, TYPE, TASK, DESCRIPT, NOTE from
TASKS where " & strTypeForSearch & strRequestor & strDateRange & "
((TASK like '%" & arySearchTerms(0) & "%'" &
strAdditionalSearchTermsTask & ") or (DESCRIPT like '%" &
arySearchTerms(0) & "%'" & strAdditionalSearchTermsDescript & ") or
(NOTE like '%" & arySearchTerms(0) & "%'" & strAdditionalSearchTermsNote
& ")) order by WO_NUM desc"

response.write(strQuery)

Set ExactResultsList = cnxW.Execute(strQuery)
If Not(ExactResultsList.BOF And ExactResultsList.EOF) Then
	aryExactResultsList = ExactResultsList.GetRows
	Set ExactResultsList = Nothing
	Response.Write("<h1 class=""warning"">Exact Matches</h1>")
	Response.Write("<table>")
	Response.Write("<th>WO#</th><th>Req.
Date</th><th>Type</th><th>Summary</th><th>Description</th><th>Updates</t
h></tr>" & vbCrLf)
	For i = 0 to UBound(aryExactResultsList,2)
		With Response
			.Write("<tr class=""small"">" & vbCrLf & vbCrLf)
			.Write("<td>" & aryExactResultsList(0,i) &
"</td>" & vbCrLf)
			.Write("<td>" & aryExactResultsList(1,i) &
"</td>" & vbCrLf)
			.Write("<td>" & aryExactResultsList(2,i) &
"</td>" & vbCrLf)
			.Write("<td>" & aryExactResultsList(3,i) &
"</td>" & vbCrLf)
			.Write("<td>" & aryExactResultsList(4,i) &
"</td>" & vbCrLf)
			.Write("<td>" & aryExactResultsList(5,i) &
"</td>" & vbCrLf)
			.Write("</tr>" & vbCrLf & vbCrLf)
		End With
	Next
	Response.Write("</table>")
End If

The query as spewed to the page is

select WO_NUM, REQDATE, TYPE, TASK, DESCRIPT, NOTE from TASKS where
REQDATE between '2004-01-01' and '2006-09-30' and ((TASK like
'%joecanfi%' And TASK like '%micmarti%' And TASK like '%pactrac%' ) or
(DESCRIPT like '%joecanfi%' And DESCRIPT like '%micmarti%' And DESCRIPT
like '%pactrac%' ) or (NOTE like '%joecanfi%' And NOTE like '%micmarti%'
And NOTE like '%pactrac%' )) order by WO_NUM desc

The contents returned for the DESCRIPT field [which I sincerely hope is
aryExactResultsList(4,i)] are plain text, nothing unusual or surprising.
I have eleventyleven web tools accessing this data, so I'm fairly sure
it's not the data.

Thanks.

joel



More information about the thelist mailing list