Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

List all employees
Hi All

I have a table which stores the employee details. The format of the table is
below

EmpNo _ Integer
FirstName  - Text
Lastname - Text
ManagerNo - Integer

What I would like to do is to display in a tree structure all the employees
reporting to a particular employee.

For examples I might have 4 people reporting to me and also might have other
employees reporting to those who report to me. Something like the structure
below.

Employee A
Employee B
Employee B.1
Employee B.2
Employee C
Employee D
Employee D.1
Employee D.2
Employee D.2.2
Employee E

Anyone has any idea who this can be done. Some sample code will be much
appreciated
thanks

Jas



Report this thread to moderator Post Follow-up to this message
Old Post
JP SIngh
10-27-04 08:55 PM


Re: List all employees
If you are using SQL Server, look up "Expanding Hierarchies" in BOL. If some
other database, post back and let us know which one.

Bob Barrows
JP SIngh wrote:
> Hi All
>
> I have a table which stores the employee details. The format of the
> table is below
>
> EmpNo _ Integer
> FirstName  - Text
> Lastname - Text
> ManagerNo - Integer
>
> What I would like to do is to display in a tree structure all the
> employees reporting to a particular employee.
>
> For examples I might have 4 people reporting to me and also might
> have other employees reporting to those who report to me. Something
> like the structure below.
>
> Employee A
>   Employee B
>           Employee B.1
>           Employee B.2
>   Employee C
>   Employee D
>       Employee D.1
>       Employee D.2
>             Employee D.2.2
>   Employee E
>
> Anyone has any idea who this can be done. Some sample code will be
> much appreciated
> thanks
>
> Jas

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
10-27-04 08:55 PM


Re: List all employees
The database is Access 2000.

thanks

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OlhmGzCvEHA.2624@TK2MSFTNGP11.phx.gbl...
> If you are using SQL Server, look up "Expanding Hierarchies" in BOL. If
some
> other database, post back and let us know which one.
>
> Bob Barrows
> JP SIngh wrote: 
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
JP SIngh
10-27-04 08:55 PM


Re: List all employees
I don't have time to thoroughly deal with this question right now (I'm at
work), so I suggest that you spend some time using Google to research using
ASP to expand hierarchical data stored in an Access table using a
self-referencing relationship  into tree views. There, that should be enough
keywords to keep you busy until tonight. Post back if you have specific
questions and I will be able to address them then.

Bob Barrows
JP SIngh wrote:
> The database is Access 2000.
>
> thanks
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:OlhmGzCvEHA.2624@TK2MSFTNGP11.phx.gbl... 

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Report this thread to moderator Post Follow-up to this message
Old Post
Bob Barrows [MVP]
10-27-04 08:55 PM


Re: List all employees
"JP SIngh" <none@none.com> wrote in message
news:OEQmHwCvEHA.3728@TK2MSFTNGP12.phx.gbl...
> Hi All
>
> I have a table which stores the employee details. The format of the table
is
> below
>
> EmpNo _ Integer
> FirstName  - Text
> Lastname - Text
> ManagerNo - Integer
>
> What I would like to do is to display in a tree structure all the
employees
> reporting to a particular employee.
>
> For examples I might have 4 people reporting to me and also might have
other
> employees reporting to those who report to me. Something like the
structure
> below.
>
> Employee A
>   Employee B
>           Employee B.1
>           Employee B.2
>   Employee C
>   Employee D
>       Employee D.1
>       Employee D.2
>             Employee D.2.2
>   Employee E
>
> Anyone has any idea who this can be done. Some sample code will be much
> appreciated
> thanks

[url]http://groups.google.com/groups?threadm=ej7OlMSGEHA.3856%40TK2MSFTNGP12.phx.gbl[/u
rl]



Report this thread to moderator Post Follow-up to this message
Old Post
Chris Hohmann
10-27-04 08:55 PM


Re: List all employees
"Chris Hohmann" <nospam@thankyou.com> wrote in message
news:ug2L%237EvEHA.200@TK2MSFTNGP11.phx.gbl...
> "JP SIngh" <none@none.com> wrote in message
> news:OEQmHwCvEHA.3728@TK2MSFTNGP12.phx.gbl... 
table
> is 
> employees 
> other 
> structure 
>
>
http://groups.google.com/groups?thr...FTNGP12.phx.gbl



Report this thread to moderator Post Follow-up to this message
Old Post
Chris Hohmann
10-27-04 08:55 PM


Re: List all employees
Try pulling all the data back & using a recursive function to display it
within <ul>, kinda like

rs = getdata()
empid = request("employeeid")

showgrunts rs, empid

sub showgrunts(rs, id)
var rsTmp
set rsTmp = rs.clone
response.write "<ul>"
rsTmp.filter = "ManagerNo = " & id
' list employees
while not rs.eof
response.write "<li>" & rs("FirstName") & " " & rs("LastName")
' list this guys grunts
showgrunts rs, rs("EmpNo")
response.write "</li>"
rs.movenext
wend
response.write "</ul>"
set rsTmp = nothing
end sub

I'm assuming you dont have bajillions of employees.

--
Ben Strackany
www.developmentnow.com


"JP SIngh" <none@none.com> wrote in message
news:OEQmHwCvEHA.3728@TK2MSFTNGP12.phx.gbl...
> Hi All
>
> I have a table which stores the employee details. The format of the table
is
> below
>
> EmpNo _ Integer
> FirstName  - Text
> Lastname - Text
> ManagerNo - Integer
>
> What I would like to do is to display in a tree structure all the
employees
> reporting to a particular employee.
>
> For examples I might have 4 people reporting to me and also might have
other
> employees reporting to those who report to me. Something like the
structure
> below.
>
> Employee A
>   Employee B
>           Employee B.1
>           Employee B.2
>   Employee C
>   Employee D
>       Employee D.1
>       Employee D.2
>             Employee D.2.2
>   Employee E
>
> Anyone has any idea who this can be done. Some sample code will be much
> appreciated
> thanks
>
> Jas
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Ben Strackany
10-28-04 01:55 AM


Re: List all employees
HI Chris

Thanks for pointing this out. We are not fimiliar with XML hence looking for
an ASP version of the code.


"Chris Hohmann" <nospam@thankyou.com> wrote in message
news:uo1UjAFvEHA.3200@TK2MSFTNGP14.phx.gbl...
> "Chris Hohmann" <nospam@thankyou.com> wrote in message
> news:ug2L%237EvEHA.200@TK2MSFTNGP11.phx.gbl... 
> table 
much 
>
http://groups.google.com/groups?thr...FTNGP12.phx.gbl
>
> Sorry, forgot the part where you said you were using Access 2000. Here's a
> database agnostic version:
>
http://groups.google.com/groups?sel...FTNGP12.phx.gbl
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
JP SIngh
10-28-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:05 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.