PRB: Problem with SQL Sample with Unrecognized File Types

ID: Q186377

The information in this article applies to:

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%>
         <TD><% = Server.HTMLEncode(RS(i)) %></TD>
      <%else%>
         <TD><% = RS(i) %></TD>
      <%end if%>
      <%end if%>
      <% Next %>
    </TR>
   <%
      RS.MoveNext
     Loop
   RS.Close
   Conn.Close

   Set QUtil = Nothing
   %>
   </TABLE>

   <!--#include file ="is2foot.inc"-->

   </BODY>
   </HTML>

STATUS

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

MORE INFORMATION

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.

REFERENCES

For more information, refer to the Index Server documentation in the Windows NT Option Pack documentation.

Additional query words: kbDSupport kbIndexServer kbdse

Technology        : ole
Version           : WINDOWS:2.0
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: June 8, 1998