Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Blank Search, HELP..!!!


Message #1 by cyandle@c... on Mon, 30 Jul 2001 07:37:21
When I do my search, I get a blank page with just my background without the 

records.  Here is my code, anything wrong with it?





<html>



<head>

<meta name="keywords" content="chambers of commerce, chamber of commerce, 

chamber, commerce, Halifax County, Northampton County, Roanoke Valley, 

Conway, Enfield, Garysburg, Gaston, Halifax, Hobgood, Jackson, Lasker, 

Littleton, Rich Square, Roanoke Rapids, Scotland Neck, Seaboard, Severn, 

Weldon, Woodland, business, services, programs, events, community, visitor, 

visit, portal, networking, mixers, government, calendar, politics, Programs 

of Work, Organizational Improvement, Economic Development, Public Affairs, 

Area Promotions, Small Business Services, Membership Services, 

Fundraising">

<meta name="description" content="Welcome to the Official Site of the 

Roanoke Valley Chamber of Commerce. The Roanoke Valley Chamber is a growing 

organization composed of over 600 businesses throughout eastern North 

Carolina.  For over 50 years, the Chamber has strived to promote economic 

development in our area and to improve the community's quality of life.  In 

addition to serving area businesses, the Chamber also provides information 

for newcomers.  This site is a valuable resource for information about 

North Carolina's Roanoke Valley, which primarily composed of Halifax and 

Northampton Counties with Roanoke Rapids as the largest city.">

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

<style>

<!--



/*

Text Link Underline Remover Script- 

© Dynamic Drive (www.dynamicdrive.com)

For full source code, installation instructions,

100's more DHTML scripts, and Terms Of

Use, visit dynamicdrive.com

*/



a{text-decoration:none}

//-->

</style>

</head>



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



<div align="center">

  <center>

  <table border="0" cellpadding="0" cellspacing="0" width="650" 

bgcolor="#FFFFFF">

    <tr>

      <td colspan="5" height="110">

        <p align="center"><font size="2" face="MS Sans Serif"><img 

border="0" src="images/logo.jpg" width="549" height="89"> </font></p>

      </td>

    </tr>

    <tr>

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

      <td valign="top" bgcolor="#FFFFFF"> </td>

      <td valign="top">

        <p align="center"><font size="2" face="MS Sans 

Serif"> </font></p>

      </td>

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

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

    </tr>

    <tr>

      <td valign="top">

        <div align="center">

          <center>

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

          <tr>

            <td colspan="2" bgcolor="#CCCCFF" align="center"><b><font 

face="MS Sans Serif" size="2">Chamber</font></b></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/about.html">About Us</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/about.html#staff">Staff</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/newsletter.html">Newsletter</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/about.html#links">Links</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="mailto:info@r...">Contact</a></font></td>

          </tr>

          <tr>

            <td colspan="2" bgcolor="#CCCCFF" align="center"><b><font 

face="MS Sans Serif" size="2">Members</font></b></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/directory.html">Members 

Directory</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/members.html#join">How To 

Join</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/directory.html#sites">Member

              Sites</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/members.html#benefits">Benefits</a></font></

td>

          </tr>

          <tr>

            <td colspan="2" bgcolor="#CCCCFF" align="center"><b><font 

face="MS Sans Serif" size="2">Visitors</font></b></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/visitors.html#location">Location</a></font><

/td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/visitors.html#trans">Transportation</a></fon

t></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/visitors.html#health">Health 

Care</a></font></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/visitors.html#education">Education</a></font

></td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/visitors.html#employ">Employment</a></font><

/td>

          </tr>

          <tr>

            <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

            <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/visitors.html#attract">Attractions</a></font

></td>

          </tr>

          <tr>

            <td align="center"><font face="MS Sans Serif" 

size="1"> </font></td>

            <td><font face="MS Sans Serif" size="1"> </font></td>

          </tr>

        </table>

          </center>

        </div>

      </td>

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

      <td valign="top" width="400">

<% 

	'Dim local variables

	Dim sqlString, Category, ColorSwitch, RowColor



	'Get Incoming Category

	Category = request.form("txtcategory")

	

	'Build sqlString

	sqlString = "SELECT * from members"

	

	'Debugging Test

	response.write "sqlString = " & sqlString & "<p>"

	

	'Create recordset

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

	rs.Open sqlString, "DSN=rvcc"

%>

          <table border="0" cellpadding="3" width="425">

            <tr>

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

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

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

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

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

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

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

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

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

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

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

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

            </tr>

          </table>

<%

	'Set Switch

	Switch = False



	'Set record switch to first record

	rs.MoveFirst



	'Loop through all records

	while not rs.EOF



	'Check row color

	IF ColorSwitch = False THEN

		RowColor = "FFFFFF"

	ELSEIF ColorSwitch = True THEN

		RowColor = "0000FF"

	END IF



%>

          <table border="0" cellpadding="3" width="425">

            <tr>

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

color="#0000FF"><%=rs("Company")%></font></b></td>

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

color="#0000FF"><%=rs("Address")%></font></b></td>

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

color="#0000FF"><%=rs("City")%></font></b></td>

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

color="#0000FF"><%=rs("State")%></font></b></td>

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

color="#0000FF"><%=rs("Phone")%></font></b></td>

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

color="#0000FF"><%=rs("Website")%></font></b></td>

            </tr>



<%

	'Next record

	rs.MoveNext



	IF ColorSwitch = False THEN

		ColorSwitch = True

	ELSE 

		ColorSwitch = False

	END IF



	wend

%>



</table>



<%

	'Close Recordset

	rs.close

%>

        </div>

        <p> 

      </td>

      <td valign="top">

         

      </td>

      <td valign="top">

        <div align="center">

          <center>

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

            <tr>

              <td colspan="2" bgcolor="#CCCCFF" align="center"><b><font 

face="MS Sans Serif" size="2">Programs</font></b></td>

            </tr>

            <tr>

              <td align="center">

                <img border="0" src="images/bluedot.gif" width="8" 

height="7">

              </td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/programs.html">Programs

                of Work</a></font></td>

            </tr>

            <tr>

              <td align="center">

                <p align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></p>

              </td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/organ.html">Organizational 

Improvement</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/develop.html">Economic 

Development</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/public.html">Public Affairs</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/promo.html">Area Promotions</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/small.html">Small Business 

Services</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/mservices.html">Membership 

Services</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/funds.html">Fundraising</a></font></td>

            </tr>

            <tr>

              <td colspan="2" bgcolor="#CCCCFF" align="center"><b><font 

face="MS Sans Serif" size="2">Events</font></b></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/calendar.html">Calendar</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/events.html">Business Expo</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/events.html">Ducky Derby</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/events.html">Car Party</a></font></td>

            </tr>

            <tr>

              <td colspan="2" bgcolor="#CCCCFF" align="center"><b><font 

face="MS Sans Serif" size="2">Political</font></b></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/political.html#medicaid">Medicaid</a></font>

</td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/political.html#toll">Toll 

Roads</a></font></td>

            </tr>

            <tr>

              <td align="center"><img border="0" src="images/bluedot.gif" 

width="8" height="7"></td>

              <td><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com/political.html#enlighten">Enlighten 

Us</a></font></td>

            </tr>

          </table>

          </center>

        </div>

      </td>

    </tr>

    <tr>

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

      <td> </td>

      <td> </td>

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

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

    </tr>

    <tr>

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

      <td> </td>

      <td height="35">

        <p align="center"><font face="MS Sans Serif" size="1"><a 

href="http://www.rvchamber.com"><b>Home</b></a>

        | <a href="http://www.rvchamber.com/about.html"><b>About Us</b></a> 

| <a href="http://www.rvchamber.com/members.html"><b>Members</b></a>

        | <b><a 

href="http://www.rvchamber.com/visitors.html">Visitors</a></b> |

        <b><a 

href="http://www.rvchamber.com/newsletter.html">Newsletter</a></b>

        | <b><a href="http://www.rvchamber.com/events.html">Events</a></b>

        | <b><a 

href="http://www.rvchamber.com/political.html">Political</a></b>

        | <b><a 

href="mailto:info@r...">Contact</a></b> </font></p>

      </td>

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

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

    </tr>

    <tr>

      <td colspan="5" height="30">

        <p align="center"><font size="1" face="MS Sans Serif">RV Chamber of

        Commerce  |  P. O. Box 519  |  Roanoke Rapids, 

NC

        27870  |  Phone: (252) 537-3513  |  Fax: (252)

        535-5767</font></td>

    </tr>

    <tr>

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

        <p align="center"><font size="1" face="MS Sans Serif">Copyright 

© 2001

        Roanoke Valley Chamber of Commerce.  All Rights Reserved.<br>

        Site Designed and Created by <a 

href="http://www.citylog.com"><b>CityLog.com<br>

        </b></a> Photographs By Les Atkins<br>

         </font></td>

    </tr>

  </table>

  </center>

</div>



</body>



</html>
Message #2 by Sam Clohesy <sam@e...> on Mon, 30 Jul 2001 15:52:36 +0100
Check there are records to return and try to close all your objects



(rs.close

set rs - nothing)



As far as I can see you are doing a select 8 without any search criteria...





Message #3 by "Sergio Oliveira" <neptuno2@h...> on Mon, 30 Jul 2001 20:23:01 +0000
Hi,



It seems that your connection to the database is not very good... Try to 

debug it. you are using a DSN without an user name nor even a pw...



If I was you, I would create a stand alone connection and then I would 

create the Recodset object.



By the way, you shouldn´t use "*" in your select... put the names of the 

fields instead (however, this is not the reason of your problem, is just a 

performance consideration)



:)

Message #4 by "Sergio Quintanilla C." <sergioquintanilla@h...> on Mon, 30 Jul 2001 17:50:24 -0500
Thanks Sergio,



SQ

----- Original Message -----

From: "Sergio Oliveira" <neptuno2@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, July 30, 2001 3:23 PM

Subject: [asp_databases] Re: Blank Search, HELP..!!!





> Hi,

>

> It seems that your connection to the database is not very good... Try to

> debug it. you are using a DSN without an user name nor even a pw...

>

> If I was you, I would create a stand alone connection and then I would

> create the Recodset object.

>

> By the way, you shouldn´t use "*" in your select... put the names of the

> fields instead (however, this is not the reason of your problem, is just a

> performance consideration)

>

> :)

>

> ---


  Return to Index