Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Netscape Problem


Message #1 by Casey Yandle <cyandle@c...> on Tue, 28 Aug 2001 00:33:06 -0400
Can anyone see why my search would not work properly in Netscape (just

displays one record but in code it shows all of them)..?  I have

submitted it to the validator but it didn't tell me much.  I assume it's

something with my tables.  Here is my code:



<html>

<head>

<title>The Roanoke Valley Chamber of Commerce</title>

</head>



<body background="images/bstrip.gif" vlink="#D9D9FF" alink="#000080">



<div align="center">

  <center>

  <table border="0" cellpadding="5" cellspacing="0" width="700"

bgcolor="#FFFFFF">

    <tr>

      <td valign="top"> </td>

      <td>

        <p align="center"><img border="0" src="images/logo.jpg">

      </td>

      <td valign="top">

         

      </td>

    </tr>

    <tr>

      <td valign="top" colspan="3">

<%

 'Dim local variables

 Dim sqlString, txtCategory



 'Build sqlString

 txtCategory = Request.Form("txtcategory")

 sqlString = "SELECT Company, Address, City, State, Phone, Email,

Website FROM members WHERE Category LIKE '%" & txtCategory & "%' AND

MemberTypeID IN ('Primary', 'Associate', 'Non-Dues')"



 'Create recordset

 set rs = Server.CreateObject("ADODB.Recordset")

 rs.Open sqlString, "DSN=rvcc"



%>

        <div align="center">

          <table border="0" cellpadding="3" cellspacing="0" width="700">



            <tr bgcolor="CEE7FF">

              <td width="103"><b><font size="2" face="MS Sans Serif"

color="#0000FF">Company</font></b></td>

              <td width="108"><b><font size="2" face="MS Sans Serif"

color="#0000FF">Address</font></b></td>

              <td width="56"><b><font size="2" face="MS Sans Serif"

color="#0000FF">City</font></b></td>

              <td width="47"><b><font size="2" face="MS Sans Serif"

color="#0000FF">State</font></b></td>

              <td width="70"><b><font size="2" face="MS Sans Serif"

color="#0000FF">Phone</font></b></td>

              <td width="128"><b><font size="2" face="MS Sans Serif"

color="#0000FF">Email</font></b></td>

              <td width="133"><b><font size="2" face="MS Sans Serif"

color="#0000FF">Website</font></b></td>

            </tr>

          </table>

        </div>

<%



   If rs.EOF then

     Response.Write "<p> <center>No members were found matching your

search.  Hit back and try your search again.<p></center>"

   Else

  While Not rs.EOF



%>

        <div align="center">

          <table border="0" cellpadding="3" cellspacing="0" width="700">



            <tr>

              <td width="102"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("Company") & " "%></font></td>

              <td width="107"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("Address") & " "%></font></td>

              <td width="57"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("City") & " "%></font></td>

              <td width="47"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("State") & " "%></font></td>

              <td width="70"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("Phone") & " "%></font></td>

              <td width="127"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("Email") & " "%></font></td>

              <td width="132"><font face="MS Sans Serif" color="#000000"

size="1"><%=rs("Website") & " "%></font></td>

            </tr>



<%

 'Next record

 rs.MoveNext



 wend

 End If



 'Close Recordset

 rs.close

 Set rs=nothing

%>



</table>



        </div>

<p align="center"> 

      </td>

    </tr>

  </table>



</body>

</html>





Also does anyone know how to do the target thing so that when the users

click submit their search pops up in another new window?  Thanks.



Casey Yandle



Message #2 by Steve Carter <Steve.Carter@t...> on Tue, 28 Aug 2001 10:02:39 +0100
IIRC,



target="_blank"





> Also does anyone know how to do the target thing so that when 

> the users

> click submit their search pops up in another new window?  Thanks.

Message #3 by "Dan McKinnon" <mddonna@u...> on Wed, 29 Aug 2001 01:11:41
I used to work as a browser cross-compatibility engineer. If you can see 

the data that asp sent to the html stream in the source code of the page, 

and you can't see the same data displayed in the Netscape browser, then 

Netscape didn't like the way the page was written. In my experience, this 

was most often caused by one or more </table> tags missing, but could be a 

number of other things as well, including missing </tr> tags, </td> tags, 

and what have you. You should be able to figure it out, especially if you 

have the source code. If you copy the source code into HomeSite and run 

the validator on it, it will tell you stuff like that (but you may have to 

configure HomeSite to only display meaningful errors, which can be time-

consuming). The validator you're talking about, is it the HomeSite 

validator? And did you run it on the code that came back from ASP or the 

raw asp page before it's processed? It makes a big difference, especially 

considering the branching statement.



Also, I should probably look at your code closer (I don't have time now), 

but if the first part of the branching statement is used, the one where 

the data isn't found, don't you have too many closing </table> tags in 

that case?



At least your problem isn't in the mechanics of the ASP code. That's worth 

something. (i.e., data is being returned to the html stream)



Dan
Message #4 by cyandle@c... on Wed, 29 Aug 2001 01:38:15
Thanks for that...just to let everyone else know, I don't need anymore help.  Have fixed both 

issues...thanks...



Casey Yandle

  Return to Index