Instead of using
While NOT rsNewsItems.EOF
........your code
Wend
Use
IF rsNewsItems.EOF Then
Response.write "No matching records Found"
ELSE
Do While NOT rsNewsItems.EOF
.......your code
Loop
END IF
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________
|I am working from code that someone else developed and trying to make
| enhancements.
|
| Here is my code so maybe someone can tell me exactly what and where the
| statement needs to go.
|
|
| <%
| strConn = "Provider=SQLOLEDB.1;Persist Security
| Info=True;Password=is229002;User ID=webuser;Data Source=10.1.1.92;Initial
| Catalog=Westar-Online"
| set objConn = server.createobject("ADODB.Connection")
| objConn.Open strConn
|
| strSQL = "SELECT * FROM JobOpenings " & _
| "WHERE (WorkLocation IN ('Corpus Christi','Ft. Hood','El Paso','Harker
| Heights')) " & _
| " AND ExternalyAvailable <> 'No' AND MarkAsDeleted <> 'Yes'" & _
| "ORDER BY JobCode DESC"
|
| set rsNewsItems = Server.CreateObject("ADODB.Recordset")
| rsNewsItems.Source = strSQL
| rsNewsItems.ActiveConnection = objConn
| rsNewsItems.CursorType = adOpenForwardOnly
| rsNewsItems.Open
|
| %>
| <html>
| <?xml version="1.0" encoding="iso-8859-1"?>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="
http://www.w3.org/1999/xhtml">
|
| <head>
| <title>Westar Aerospace & Defense Group - A QinetiQ Company</title>
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
| <link rel="stylesheet" href="style.css">
| <style type="text/css" media="all">
| <!--
| @import url(main.css);
| @import url(level_02.css);
| -->
| </style>
|
| <script language="JavaScript">
| <!--
| function MM_preloadImages() { //v3.0
| var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
| var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
| if (a
.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
| }
|
| function MM_swapImgRestore() { //v3.0
| var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
| x.src=x.oSrc;
| }
|
| function MM_findObj(n, d) { //v3.0
| var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
| d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
| if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
| x=d.forms[n];
| for(i=0;!x&&d.layers&&i<d.layers.length;i++)
| x=MM_findObj(n,d.layers.document); return x;
| }
|
| function MM_swapImage() { //v3.0
| var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
| for(i=0;i<(a.length-2);i+=3)
| if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
| x.oSrc=x.src; x.src=a[i+2];}
| }
| //-->
| </script>
| <script language="javascript" type="text/javascript"
| src="dmstatscript.js"></script>
| <script>
| DMPage();
| </script>
|
|
| </head>
|
| <body>
| <div id="pagewrapper">
|
| <div id="logotop">
| <a href="../index.asp" id="homelink" title="Westar Aerospace & Defense Group
| - A QinetiQ Company Home Page">Home Page</a>
| </div>
|
| <div id="navtop"> <a href="../about/index.asp" id="link01" title="About
| Westar">About
| Westar</a> <a href="../capabilities/index.asp" id="link03" title="Westar
| Capabilities">Capabilities</a>
| <a href="../news/index.asp" id="link04" title="Westar News & Events">News
| & Events</a> <a href="index.asp" id="link05" title="Careers at Westar"
| class="active">Careers</a>
| <a href="../contacts/index.asp" id="link06" title="Contact
| Westar">Contacts</a>
| </div>
|
| <div id="breadcrumbs"><a href="../index.asp">Home</a> » <a
| href="index.asp">Careers</a> » Current Openings
| » Alabama</div>
|
| <div id="contentmain">
|
| <div id="activestage" style="width: 516px; height: 312px">
|
| <h1 id="sectiontitle">Current Openings in Texas</h1>
|
| </head>
|
| <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" link="#333333"
| onLoad=";Stats()" stats=1 vlink="#666666" alink="#CC0000">
| <td height="157">
| <table width="454" border="0" cellspacing="0" cellpadding="0" height="18">
| <!--DWLayoutTable-->
| <tr>
| <td width="14"></td>
| <td valign="top" class="bodycopy" width="412"> <table width="100%"
| border="0" cellspacing="0" cellpadding="0">
| <%
| Dim rsUserSpec
| Dim rsLocSpec
| Dim LocName
| While NOT rsNewsItems.EOF
|
| strSQL4 = "SELECT OfficeName FROM Offices WHERE LocationName = '" &
| rsNewsItems("WorkLocation") & "'"
| set rsLocName = Server.CreateObject("ADODB.Recordset")
| rsLocName.Source = strSQL4
| rsLocName.ActiveConnection = objConn
| rsLocName.CursorType = adOpenForwardOnly
| rsLocName.Open
|
|
| Response.Write("<tr>")
|
| Response.Write("<td class=""bodycopy"" width=""79%""
| valign=""top""><B>Position:</B> " & rsNewsItems("PositionTitle") & "<BR>")
| Response.Write("<B>Location:</B> " & rsLocName("OfficeName") & "<BR>")
| Response.Write("<B>Description:</B> " & rsNewsItems("PositionDescription") &
| "<BR>")
|
| Response.Write("<B>For more information:</B> <A HREF=jobcode.asp?id=" &
| rsNewsItems("JobCode") & ">Click Here</A>" & "<BR>")
| Response.Write("<img src=""../shim.gif"" width=""10"" height=""10""> </td>")
| Response.Write("</tr>")
| Response.Write("<tr bgcolor=""#666666"">")
| Response.Write("<td class=""bodycopy"" width=""79%"" valign=""top""><img
| src=""../shim.gif"" width=""1"" height=""1""></td>")
| Response.Write("</tr>")
| rsNewsItems.MoveNext
| Wend
|
|
| End If
|
|
| set rsNewsItems = Nothing
| set rsUserSpec = Nothing
| set rsLocSpec = Nothing
| objConn.Close
| set objConn = Nothing
|
|
|
| ' <tr>
| ' <td class="bodycopy" width="79%" valign="top"><b><!--begin dynamic content
| -->Position:</b>
| ' STRUCTURAL ENGINEER <br>
| ' <b>Location: </b>HEC <br>
| ' <b>Description: </b>Position requires recent experience
| ' in classical stress analysis, finite element analysis,
| ' design and analysis of aircraft structural modifications,
| ' structural loads analysis of aircraft, strength analysis
| ' of aircraft airframe, empennage, nacelle and land<br>
| ' <b>Referral #: </b>503<br>
| ' <b>Contact: </b>Send <a href="mailto:[email protected]">Rock
| ' Rhoades </a>an e-mail or call (256) 430-1610 <!--end dynamic content --><br>
| ' <img src="../shim.gif" width="10" height="10"> </td>
| ' </tr>
| ' <tr bgcolor="#666666">
| ' <td class="bodycopy" width="79%" valign="top"><img src="../shim.gif"
| width="1" height="1"></td>
| ' </tr>
|
| %>
| <tr>
| <td class="bodycopy" width="79%" valign="top"> </td>
| </tr>
| </table></td>
| <td height="18" width="28"></td>
| </tr>
| </table>
|
| <!-- #include file="footer.html" -->
| </body>
| </html>
|
|
| Thanks,
|
| Lauren
|
| "Nicholas Savalas - http://savalas.tv" wrote:
|
| > Dear Lauren,
| > I went to your site http://www.westar.com/careers/openings2.asp, and
| > was looking for a job in Afghanistan. When I submitted my query, I was
| > taken to a page called Afghanistan.asp. I cannot see your code,
| > obviously, so I can't tell what is going on there. If you're using the
| > database results wizard, the page will submit to itself. The results
| > of your query will show on the same page that the query was made on.
| > The database results wizard will even give you an option of entering
| > exactly what terminology that you would like to use when no results are
| > found. Try creating a new connection to your database, make a new page
| > with the database results wizard, and test it. While I am not crazy
| > about wizards, in your case this may be just the thing you need. Good
| > luck, stay in touch.
| >
| >