473,508 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Want recursive SQL query function to generate breadcrumb navigation

I'd want to make a custom class that will generate breadcrumb navigation for
my site via a recursive query, e.g. Home > Page1 > Subpage 1. I've
structured my database with hierarchical parent/child relationships. Can
someone help me set up the code structure?

I'm using ASP VBScript, and I have a table structure similar to the
following:

NavItems
----------
NavitemID (PK)
Nav_ParentID
Nav_Name

The top level record in the entire table is "1", but it would be nice if I
could parameterize the function so that I could specify the ID of the
current page and the ID of the topmost ID I want to trace to, e.g.

GetTrailOfBreadcrumbs(CurrentNavitemID, TopmostNavitemID)

The least expensive approach from the standpoint of the database would be
something that used something besides ADO recordsets to grab the data. If
someone has some code lying around or can offer some guidance, I'd sure
appreciate it.

Thanks.

-KF
Jul 22 '05 #1
2 6736
ke*****@u.washington.edu wrote:
I'd want to make a custom class that will generate breadcrumb
navigation for my site via a recursive query, e.g. Home > Page1 >
Subpage 1. I've structured my database


What database? It's relevant.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
I use SQL Server 2000, and I have access to stored procedures.

Whatever's returned by the DB needs to have more information than just the
text label, since I'm also going to want to be generating HTML links from
this. My database table includes a "link" field.

Thanks again, Bob.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:um**************@TK2MSFTNGP14.phx.gbl...
ke*****@u.washington.edu wrote:
I'd want to make a custom class that will generate breadcrumb
navigation for my site via a recursive query, e.g. Home > Page1 >
Subpage 1. I've structured my database


What database? It's relevant.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #3

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

Similar topics

2
2899
by: Eric | last post by:
I am looking for a breadcrumb class in PHP that does not rely on the directory structure to build the trail. I have been using Richard Baskettes - http://www.baskettcase.com/classes/breadcrumb/...
9
2791
by: JP SIngh | last post by:
Hi All I am trying to write a recursive function to list the managers and his employees in a tree like sctructure Manager 1 Emp1 Emp1.1 Emp 1.2 Emp 2
6
4520
by: Einar ?rn | last post by:
Hi all, is there a good way to detect recursive C code in large systems? A method or a free tool? Best regards, E
7
6105
by: Aloo | last post by:
Dear friends, If we declare a recursive function as 'inline' then does it actually convert to an iterative form during compilation ( the executable code is iterative)? Is it possible ? ...
3
2204
by: Stephanie Le Gall | last post by:
Hello, I'm using a recursive function to get an array of ID from a database passing the array by reference. I need this structure for the function because the database structure is like a...
3
2396
by: DBdealer via DotNetMonster.com | last post by:
I'm trying to build a breadcrum navigation bar for my website....please can some one suggest me ways...It's a 100 page site and I need it for navigation with the site....Thank you -- Message...
24
4625
by: Phil Latio | last post by:
Let's say I have a simple web application running with just two MySQL tables. The tables structure is as follows: Table: category category_id (PK) category_name parent_category (FK)...
2
2924
by: HuifangZhang | last post by:
Could any one help with recursive functions on generating subsets? Write a function ListSubsets that generates all possible subsets of a given set, where the set is represented by a string of...
3
4115
by: Justino | last post by:
Hi, I'm trying to integrate breadcrumb based navigation on my site, but have hit a wall. I have an array that pulls from a MySQL data tree (hierarchical) based on a variable passed in the url....
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.