Want recursive SQL query function to generate breadcrumb navigation

Discussion in 'ASP General' started by Guest, Mar 30, 2005.

  1. Guest

    Guest Guest

    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
     
    Guest, Mar 30, 2005
    #1
    1. Advertising

  2. 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"
     
    Bob Barrows [MVP], Mar 30, 2005
    #2
    1. Advertising

  3. Guest

    Guest Guest

    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]" <> wrote in message
    news:...
    > 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"
    >
    >
     
    Guest, Mar 30, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Harris

    BreadCrumb Trail

    Simon Harris, Jun 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,655
    Simon Harris
    Jun 26, 2004
  2. TG
    Replies:
    1
    Views:
    3,280
    Hermit Dave
    Sep 29, 2004
  3. Anonymous
    Replies:
    0
    Views:
    1,550
    Anonymous
    Oct 13, 2005
  4. DBdealer via DotNetMonster.com

    Breadcrumb Navigation bar

    DBdealer via DotNetMonster.com, Sep 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    620
    DBdealer via DotNetMonster.com
    Sep 11, 2006
  5. n00m
    Replies:
    12
    Views:
    1,144
Loading...

Share This Page