473,659 Members | 2,632 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.

GetTrailOfBread crumbs(CurrentN avitemID, TopmostNavitemI D)

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 6743
ke*****@u.washi ngton.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******@NOyah oo.SPAMcom> wrote in message
news:um******** ******@TK2MSFTN GP14.phx.gbl...
ke*****@u.washi ngton.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
2906
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/ - breadcrumb classes and they are great... BUT. I have a site that is being built using templates and the directory hierarchy can not be used to create the trail. Sorry if you read this post in alt.lang.php.
9
2796
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
4545
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
6122
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 ? Please reply.
3
2212
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 tree and there is no limit of level. Here is the code :
3
2401
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 posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200609/1
24
4661
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) //references category_id in this table Table: link link_id (PK)
2
2948
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 letters. If you call the function: ListSubsets("ABC") your function should produce the following output: ABC AB AC A
3
4126
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. http://www.mysite.com?category=apples will output food fruit > apples. I have everything working but instead of passing the string in the url I'd rather pass the numerical id and use the string for displaying only. I used the ‘adjacency list...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4176
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2759
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 we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.