473,386 Members | 1,706 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,386 software developers and data experts.

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
Jul 21 '05 #1
7 1359
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.
Jul 21 '05 #2
The database is Access 2000.

thanks

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Ol**************@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:
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.

Jul 21 '05 #3
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:Ol**************@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:
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.


--
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.
Jul 21 '05 #4
"JP SIngh" <no**@none.com> wrote in message
news:OE**************@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


http://groups.google.com/groups?thre...TNGP12.phx.gbl
Jul 21 '05 #5
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:ug***************@TK2MSFTNGP11.phx.gbl...
"JP SIngh" <no**@none.com> wrote in message
news:OE**************@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


http://groups.google.com/groups?thre...TNGP12.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?selm...TNGP12.phx.gbl
Jul 21 '05 #6
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" <no**@none.com> wrote in message
news:OE**************@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

Jul 21 '05 #7
HI Chris

Thanks for pointing this out. We are not fimiliar with XML hence looking for
an ASP version of the code.
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:uo**************@TK2MSFTNGP14.phx.gbl...
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:ug***************@TK2MSFTNGP11.phx.gbl...
"JP SIngh" <no**@none.com> wrote in message
news:OE**************@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


http://groups.google.com/groups?thre...TNGP12.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?selm...TNGP12.phx.gbl

Jul 21 '05 #8

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

Similar topics

1
by: Melissa Kay Beeline | last post by:
OK, here's the sitch : we have an access control system at work that registers ever entry/exit of every employee. I recently made some queries in Access so the ppl in HR could make reports (who...
2
by: Kelly | last post by:
I have a subform that display requisition information. One of the fields in the subform is a combo box that shows who requested the requisition. The users can change who requested the requisition...
2
by: ormy28 | last post by:
I really need some help with the following problem if anyone would be willing. I need a list box to list the opposite of what appears in a query. Heres the details: My database is for a...
7
by: Jon Davis | last post by:
I'm managing "collections" / "lists" (??) of objects that are internally bound by an XML document, but I do NOT intend to offer an IEnumerator interface. For instance, with a root XML document,...
1
by: CR | last post by:
I'm trying to alphabetically sort a linear linked list by both last name and first name data portions. I can't figure out how to do this; I should be able to do it no problem but I am really...
2
by: Archu | last post by:
hello 2 everyone pls solve my problem m using 2 tables employees and department i want to use 2 drop down list Ist 4 department and 2nd for employees but only those employees should cum whom...
1
by: Zeeshan7 | last post by:
Hi, I want to distribute a list (equally) between employees:- I have two tables in MS Access: 1- Employee table: Fields are; Emp_No, Emp_Name and Billing_Date i.e. 15 (for all employees) ...
7
by: Abhishek | last post by:
Hi I am using a generic list in my program to have a list of objects stored. I want to compare all the objects in this list with object of another class and find all the objects which meet the...
1
by: injanib via AccessMonster.com | last post by:
is it possible that if the limit to list property of a combobox is set to true the focus is passed onto another field? What I mean is that I have a combo box with the limit to list property set to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...

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.