Microsoft KB Archive/186377

= PRB: Problem with SQL Sample with Unrecognized File Types =

Article ID: 186377

Article Last Modified on 7/19/2001

-

APPLIES TO


 * Microsoft OLE DB Provider for Index Server 2.0

-



This article was previously published under Q186377



SYMPTOMS
Using the SQL sample that ships with Index Server 2.0 in the Windows NT 4.0 Option Pack, the browser may show formatting problems with some file types in the results of a query.



CAUSE
If the display results of the query using Sqlqhit.asp include files with extensions that are unrecognized, Index Server uses the default text filter. If this file contains HTML, the HTML escape characters are not properly recognized by the scripting code in the Sqlqhit.asp file. So, the browser becomes confused and treats these as if they are HTML and this creates formatting problems.



RESOLUTION
You can fix this problem by adding three lines of code close to the end of the Sqlqhit.asp file.

The sample code below shows how the last 23 lines of the Sqlqhit.asp file should appear (the addition is the new If statement in the beginning).

Sample Code
<%else%> <%if VarType(RS(i)) = 8 then%> <% = Server.HTMLEncode(RS(i)) %> <%else%> <% = RS(i) %> <%end if%> <%end if%> <% Next %>  <%     RS.MoveNext Loop RS.Close Conn.Close

Set QUtil = Nothing %>  

 



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
Using the SQL sample (that uses the Sqlqhit.asp file), search for a keyword that exists in a file that also contains HTML but the file has a different file extension. One such example is the Ado15.hhk file.

For example, you can see this problem occur when you use the SQL sample and run the following query:

Select * from fileinfo where CONTAINS('RollbackTrans')>0

The bottom row is not formed correctly and the following message displays:

Your current security settings prohibit running ActiveX controls on this page. As a result, the page may not display correctly.

This is a result of the browser trying to interpret the results as part of its logic rather than just displaying the results.

