Hov! Glemte at sige at jeg bruger denne helt for oven i filen:
SQLstmt7 = "SELECT * FROM job ORDER BY dato2 ASC LIMIT 0, 12;" SQLstmt11 = "SELECT * FROM job ORDER BY dato2 ASC LIMIT 12, 40;" ' 'response.write SQLstmt
Den skal uden om det loop, der lister dine ledige jobs.
Altså noget i stil med dette:
' Åbn recordsettet
' Kontroller om recordsettet er tomt If Not objRS.EOF Then ' Hvis det ikke er tomt, vis alle ledige jobs med dit eksisterende loop Else Response.Write "Der er ingen ledige jobs" End If
SQLstmt7 = "SELECT * FROM job ORDER BY dato2 ASC LIMIT 0, 12;" SQLstmt11 = "SELECT * FROM job ORDER BY dato2 ASC LIMIT 12, 40;" ' 'response.write SQLstmt
FoldNumber = 3 //How many toplinks do you have? var stayFolded = false //Stay open when you click a new toplink? foldImg = 1 //Do you want images (if not set to 0 and remove the images from the body)? mainOffsetY = 0 //Vertical space adjustment between the main items, in pixels.
//This is the default image. //Remember to change the actual images in the page as well, but remember to keep the name of the image. var unImg=new Image(); unImg.src='foldoutmenu_arrow.gif'
var exImg=new Image(); //Making an image variable... exImg.src='foldoutmenu_arrow_open.gif' //...this is the source of the image that it changes to when the menu expands.
// NOTE: if you change the position of divCont from absolute to relative, you can put the foldoutmenu in a table. // HOWEVER it will no longer work in netscape 4. If you wish to support netscape 4, you have to use absolute positioning.
/*** There should be no need to change anything beyond this. ***/
// A unit of measure that will be added when setting the position of a layer. var px = bw.ns4||window.opera?"":"px";
//object constructor... function makeMenu(obj,nest){ nest= (!nest)?"":'document.'+nest+'.'; this.el= bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj); this.css= bw.ns4?this.el:this.el.style; this.ref= bw.ns4?this.el.document:document; this.x= (bw.ns4||bw.opera5)?this.css.left:this.el.offsetLeft; this.y= (bw.ns4||bw.opera5)?this.css.top:this.el.offsetTop; this.h= (bw.ie||bw.ns6)?this.el.offsetHeight:bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:0; this.vis= b_vis; this.hideIt= b_hideIt; this.showIt= b_showIt; this.moveIt= b_moveIt; return this } //object methods... function b_showIt(){this.css.visibility='visible'} function b_hideIt(){this.css.visibility='hidden'} function b_vis(){if(this.css.visibility=='hidden' || this.css.visibility=='HIDDEN' || this.css.visibility=='hide') return true;} function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px}
/************************************************************************************ This is the function that changes the sub menus to folded or unfolded state. ************************************************************************************/ function menu(num){ if(bw.bw){ if (!stayFolded){ for (var i=0; i<oSub.length; i++){ if (i!=num){ oSub[i].hideIt() if (foldImg)oTop[i].ref["imgA"+i].src = unImg.src } } for(var i=1; i<oTop.length; i++){ oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h) } } if (oSub[num].vis()){ oSub[num].showIt() if (foldImg)oTop[num].ref["imgA"+num].src = exImg.src }else{ oSub[num].hideIt() if(foldImg)oTop[num].ref["imgA"+num].src = unImg.src } for(var i=1; i<oTop.length; i++){ if (!oSub[i-1].vis()) oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+oSub[i-1].h+mainOffsetY) else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+mainOffsetY) } } }
/********************************************************************* The init function... there should be no need to change anything here. *********************************************************************/ function initFoldout(){ //Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!! bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false if (bw.opera5) bw.ns6 = 0
oTop = new Array() oSub = new Array() //Making the objects and hiding the subs... for (var i=0; i<FoldNumber; i++){ oTop[i] = new makeMenu('divTop'+i,'divCont') oSub[i] = new makeMenu('divSub'+i,'divCont.document.divTop'+i) oSub[i].hideIt() }
//Positioning the top objects... oTop[0].moveIt(0,0) for (var i=1; i<oTop.length; i++){ oTop[i].moveIt(0, oTop[i-1].y+oTop[i-1].h+mainOffsetY) }
//Making the containing menu object and showing it... oCont = new makeMenu('divCont') oCont.showIt() }
// If the browser is ok, the script is started onload... if(bw.bw) onload = initFoldout; </script> <title>Velkommen til Albertslund Apotek..</title> <meta name="description" content=""> <meta name="keywords" content=""> </head> <body leftmargin="0" topmargin="0" marginheight="0"> <!--#include file="top.asp"--> <!--#include file="top2.asp"--> <table width="600" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="3" height="364" valign="top" bgcolor="#6699cc"><img src="b_07.gif" width="3" height="70"></td> <!--#include file="omapoteket_menu_inc.asp"--> <td width="7"></td> <td width="413" valign="top"> <p> </p> <table width="412" border="0" background="overskrift.gif"> <tr> <td width="406" height="8"><strong><font color="#FFFFFF" size="1">Ledige stillinger på apoteket</font></strong></td> </tr> </table> <table width="412" border="0" background="overskrift2.gif"> <tr> <td width="406" height="1"></td> </tr> </table> <strong><br> </strong> <table border="0" width="400" cellspacing="0" cellpadding="0" height="69"> <tr> <td valign="top" colspan="3" align="right" height="3"></td> </tr> <tr> <% DO WHILE NOT rs7.EOF artid = rs7("id") overskrift = rs7("overskrift") tekst = left(rs7("tekst"),200) dato = rs7("dato") dato2 = rs7("dato2")
%> </tr> </table> </p> <table border="0" cellpadding="0" cellspacing="2" width="405"> <% DO WHILE NOT rs11.EOF id = rs11("id") overskrift = rs11("overskrift") dato = rs11("dato") dato2 = rs11("dato2") Response.Write "<tr background='hvid.gif'>" Response.Write "<td>" %> <a href="vis_job.asp?artid=<%=id%>" target="_self"><img src="pil.gif" width="18" height="13" border="0"><b><%=overskrift%> - </b><font size="-2">(<%=dato%>)</font></a> <br> <br> <%
Response.Write "</td>" Response.Write "</tr>" rs11.MoveNext LOOP RS11.Close %> <tr> <td></td> </tr> </table> <p align="center"><br> </p> <table width="412" border="0" background="overskrift.gif"> <tr> <td width="406" height="8"><strong><font color="#FFFFFF" size="1">Søg stilling uopfordret</font></strong></td> </tr> </table> <table width="412" border="0" background="overskrift2.gif"> <tr> <td width="406" height="1"></td> </tr> </table> <p> Hvis der ikke er nogle ledige jobs som matcher dig, kan du vælge at søge uopfordret, da vi altid leder efter dygtige medarbejdere.<br> <br> Alle uopfordrede ansøgninger behandles fortroligt og besvares skriftligt.<br> <br> Den uopfordrede ansøgning bør indeholde jobønske, årsagen til at du søger et job hos Albertslund Apotek, samt et fyldigt CV med beskrivelse af uddannelse, tidligere arbejdsområder etc.<br> <br> For at imødekomme alle vore ansøgere gemmer apoteket din ansøgning i vores jobbank i op til 6 måneder. Efter 6 måneder kasseres din ansøgning, men du er selvfølgelig herefter velkommen til at sende en ny.</p> <p>Alle uopfordrede ansøgninger sendes til:<br> <a href="mailto:apoteket@albertslundapotek.dk"><strong>apoteket@albertslundapotek.dk</strong></a><strong><br> </strong><br> Eller sendes pr. almindelig post til:<br> <strong>Att.:Vinnie Krogh <br> Albertslund Apotek<br> Bytorvet 5<br> 2620 Albertslund Apotek</strong></p> <p align="center"><br> <br> <br> <br> <a href="#top"><img src="bund_navigation.jpg" width="398" height="29" border="0"></a> </p> </td> <td width="17" valign="top"> <div align="right"></div> <font face="Geneva,Verdana,Helvetica" size="2"> </font> <div align="left"> <p> </div></td> <td width="3" valign="top" bgcolor="#6699cc"><img src="b_07.gif" width="3" height="70"></td> </tr> </table> <div align="center"> <!--#include file="bund.asp"--> </div> <% my_conn.Close Set SQLstmt7 = nothing Set SQLstmt11 = nothing %> </body> </html>
Jeg forstår stadig ikke hvad du vil med 2 recordsets, men jeg har smidt en If uden om begge, der blot skriver "der er ikke noget i rs7/rs11". Denne besked kan du selv erstatte med en mere sigende.
<%response.expires=0%>
<% SQLserveradr="x" SQLdatabase="x" SQLlogin="x" SQLpassword="x" Set my_conn = Server.CreateObject("ADODB.Connection")
SQLstmt7 = "SELECT * FROM job ORDER BY dato2 ASC LIMIT 0, 12;" SQLstmt11 = "SELECT * FROM job ORDER BY dato2 ASC LIMIT 12, 40;" ' 'response.write SQLstmt
FoldNumber = 3 //How many toplinks do you have? var stayFolded = false //Stay open when you click a new toplink? foldImg = 1 //Do you want images (if not set to 0 and remove the images from the body)? mainOffsetY = 0 //Vertical space adjustment between the main items, in pixels.
//This is the default image. //Remember to change the actual images in the page as well, but remember to keep the name of the image. var unImg=new Image(); unImg.src='foldoutmenu_arrow.gif'
var exImg=new Image(); //Making an image variable... exImg.src='foldoutmenu_arrow_open.gif' //...this is the source of the image that it changes to when the menu expands.
// NOTE: if you change the position of divCont from absolute to relative, you can put the foldoutmenu in a table. // HOWEVER it will no longer work in netscape 4. If you wish to support netscape 4, you have to use absolute positioning.
/*** There should be no need to change anything beyond this. ***/
// A unit of measure that will be added when setting the position of a layer. var px = bw.ns4||window.opera?"":"px";
//object constructor... function makeMenu(obj,nest){ nest= (!nest)?"":'document.'+nest+'.'; this.el= bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj); this.css= bw.ns4?this.el:this.el.style; this.ref= bw.ns4?this.el.document:document; this.x= (bw.ns4||bw.opera5)?this.css.left:this.el.offsetLeft; this.y= (bw.ns4||bw.opera5)?this.css.top:this.el.offsetTop; this.h= (bw.ie||bw.ns6)?this.el.offsetHeight:bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:0; this.vis= b_vis; this.hideIt= b_hideIt; this.showIt= b_showIt; this.moveIt= b_moveIt; return this } //object methods... function b_showIt(){this.css.visibility='visible'} function b_hideIt(){this.css.visibility='hidden'} function b_vis(){if(this.css.visibility=='hidden' || this.css.visibility=='HIDDEN' || this.css.visibility=='hide') return true;} function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px}
/************************************************************************************ This is the function that changes the sub menus to folded or unfolded state. ************************************************************************************/ function menu(num){ if(bw.bw){ if (!stayFolded){ for (var i=0; i<oSub.length; i++){ if (i!=num){ oSub[i].hideIt() if (foldImg)oTop[i].ref["imgA"+i].src = unImg.src } } for(var i=1; i<oTop.length; i++){ oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h) } } if (oSub[num].vis()){ oSub[num].showIt() if (foldImg)oTop[num].ref["imgA"+num].src = exImg.src }else{ oSub[num].hideIt() if(foldImg)oTop[num].ref["imgA"+num].src = unImg.src } for(var i=1; i<oTop.length; i++){ if (!oSub[i-1].vis()) oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+oSub[i-1].h+mainOffsetY) else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+mainOffsetY) } } }
/********************************************************************* The init function... there should be no need to change anything here. *********************************************************************/ function initFoldout(){ //Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!! bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false if (bw.opera5) bw.ns6 = 0
oTop = new Array() oSub = new Array() //Making the objects and hiding the subs... for (var i=0; i<FoldNumber; i++){ oTop[i] = new makeMenu('divTop'+i,'divCont') oSub[i] = new makeMenu('divSub'+i,'divCont.document.divTop'+i) oSub[i].hideIt() }
//Positioning the top objects... oTop[0].moveIt(0,0) for (var i=1; i<oTop.length; i++){ oTop[i].moveIt(0, oTop[i-1].y+oTop[i-1].h+mainOffsetY) }
//Making the containing menu object and showing it... oCont = new makeMenu('divCont') oCont.showIt() }
Else Response.Write "Der er ikke noget i rs11" End If
RS11.Close %> <tr> <td></td> </tr> </table> <p align="center"><br> </p> <table width="412" border="0" background="overskrift.gif"> <tr> <td width="406" height="8"><strong><font color="#FFFFFF" size="1">Søg stilling uopfordret</font></strong></td> </tr> </table> <table width="412" border="0" background="overskrift2.gif"> <tr> <td width="406" height="1"></td> </tr> </table> <p> Hvis der ikke er nogle ledige jobs som matcher dig, kan du vælge at søge uopfordret, da vi altid leder efter dygtige medarbejdere.<br> <br> Alle uopfordrede ansøgninger behandles fortroligt og besvares skriftligt.<br> <br> Den uopfordrede ansøgning bør indeholde jobønske, årsagen til at du søger et job hos Albertslund Apotek, samt et fyldigt CV med beskrivelse af uddannelse, tidligere arbejdsområder etc.<br> <br> For at imødekomme alle vore ansøgere gemmer apoteket din ansøgning i vores jobbank i op til 6 måneder. Efter 6 måneder kasseres din ansøgning, men du er selvfølgelig herefter velkommen til at sende en ny.</p> <p>Alle uopfordrede ansøgninger sendes til:<br> <a href="mailto:apoteket@albertslundapotek.dk"><strong>apoteket@albertslundapotek.dk</strong></a><strong><br> </strong><br> Eller sendes pr. almindelig post til:<br> <strong>Att.:Vinnie Krogh <br> Albertslund Apotek<br> Bytorvet 5<br> 2620 Albertslund Apotek</strong></p> <p align="center"><br> <br> <br> <br> <a href="#top"><img src="bund_navigation.jpg" width="398" height="29" border="0"></a> </p> </td> <td width="17" valign="top"> <div align="right"></div> <font face="Geneva,Verdana,Helvetica" size="2"> </font> <div align="left"> <p> </div></td> <td width="3" valign="top" bgcolor="#6699cc"><img src="b_07.gif" width="3" height="70"></td> </tr> </table> <div align="center"> <!--#include file="bund.asp"--> </div> <% my_conn.Close Set SQLstmt7 = nothing Set SQLstmt11 = nothing %> </body> </html>
Jeg er ked af at du ikke har fået svar før nu, men jeg har været optaget af chefen, jeg laver det nu, og du får dine point som tak for hjælpen! 1000 mange tak!! :-)
Hvis du kigger efter, har jeg forsøgt mig i det spørgsmål men jeg fatter bare ikke dit problem :-)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.