473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help with Array (I think this is what I need)

Hi All.

I have a page publlished @ http://www.shopbcn.com/directory.asp

On this page you will see a left navigation listing shops. The database also
has a category for Restaurants

Currently the left nav does a simple rs loop through the category in ID ASC
order as below
OpenDB()

sql="SELECT * FROM tblDirCats ORDER BY DirCatID ASC"
Set rsDirCats = Server.CreateObject("ADODB.Recordset")
rsDirCats.Open sql, oConn, 1, 1

Do while not rsDirCats.EOF

< html/asp which retrieved populated sub cats snipped >

rsDirCats.MoveNext
Loop

rsDirCats.Close
Set rsDirCats=nothing

CloseDB()

As new Categories are added to the database, I need to always list
Restaurants (DirCatID=75) as the final category.

I could do this using a simple if not DirCatID=75 in the rs loop and then
using another connection to go back and get the Restaurants, but I'm sure
there must be a more efficient way of doing this.

Thanks for any help in advance.

Simon
Jul 21 '05 #1
2 955
Try:

"SELECT * FROM tblDirCats ORDER BY DirCatID<>75,DirCatID ASC"

For the quick and dirty fix.

Ray at work

"Simon" <si*************@blueyonder.co.uk> wrote in message
news:JC*****************@fe1.news.blueyonder.co.uk ...
Hi All.

I have a page publlished @ http://www.shopbcn.com/directory.asp

On this page you will see a left navigation listing shops. The database
also
has a category for Restaurants

Currently the left nav does a simple rs loop through the category in ID
ASC
order as below
OpenDB()

sql="SELECT * FROM tblDirCats ORDER BY DirCatID ASC"
Set rsDirCats = Server.CreateObject("ADODB.Recordset")
rsDirCats.Open sql, oConn, 1, 1

Do while not rsDirCats.EOF

< html/asp which retrieved populated sub cats snipped >

rsDirCats.MoveNext
Loop

rsDirCats.Close
Set rsDirCats=nothing

CloseDB()

As new Categories are added to the database, I need to always list
Restaurants (DirCatID=75) as the final category.

I could do this using a simple if not DirCatID=75 in the rs loop and then
using another connection to go back and get the Restaurants, but I'm sure
there must be a more efficient way of doing this.

Thanks for any help in advance.

Simon

Jul 21 '05 #2

"Ray Costanzo wrote
Try:

"SELECT * FROM tblDirCats ORDER BY DirCatID<>75,DirCatID ASC"

For the quick and dirty fix.


Thanks Ray

That did it!

Simon
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: t0642k8 | last post by:
Help , the script is executing nice , until it come to the section below. The data out of the Database is a full string with whitespaces in between each word. For example it the variable is "the...
4
by: KellyH | last post by:
Hi, I hope someone can point me in the right direction. I'll get it out of the way: Yes, I am a college student. No, I am not looking for anyone to do my homework, just looking for help. I have...
3
by: josephweiss | last post by:
Here's my quandry my bundles table ID bottleTotal price ========================== 1 1 10.00 2 6 8.00 3 12 7.50
1
by: Jim H | last post by:
I am on a project where I am supposed to send an XML document to a SQL Server stored procedure. The XML Doc is a list strings. If in my c# function I get a list values as (string psValueList),...
4
by: Tim::.. | last post by:
I have asked this question several times and can't seem to get the answer I am looking for! I am trying to create a form that responds dynamically to the users choises within the page. At the...
8
by: Mike Nolan | last post by:
As far as I can tell, Postgres has no equivalent to greatest and least functions in Oracle. Yes, you can do the same thing with a case statement, but at the expense of writing MUCH longer SQL...
12
by: xla76 | last post by:
I have a function that returns an array of string values, occasionally the returned array value is 'Nothing' I need to check if the value is nothing before moving on - how can I do this - none of...
4
by: cfps.Christian | last post by:
We're in need of a program preferably ASP/ASP.NET (I realize the chances but we'll just start here) that will allow our help desk staff or other view what is on a user's computer without taking any...
1
by: rekhasc | last post by:
if you know the ans plz heighlite that ans 3. Interoperability classes include a. System.Runtime.InteropServices b. System.Runtime.InteropServices.CustomMarshallers...
1
by: truezplaya | last post by:
Hey Once again i'm stuck. I have an arrayList of members and i wish to cycle through this list and send a message to all connected members of that list.Here is what i thought would work. Please...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.