nomafral
05-29-2005, 03:42 AM
Hi ! I would like to listing all the recurrences from one selection ...
... but I do not succeed to understand how to proceed in order to obtain all the present recurrences in "OrganName".
In the database I use OrganName in order to select the condition "they must be ACTORS" but some of they are also "DIRECTORS" "ENTREPRENEURS" etcc; and in the "cell" of output it only exits with the voice "ACTORS"
If I eliminate "OrganName = ' ACTORS' I find 3 or 4 times the same persons in directory (tidy directory for last name and first name)
Instead I would like to find FOR SINGLE PERSON the various corresponding voices ... (I mean John | Smith | The STARMAN | Actor, Bussinessman, Manager ...).
How do make it?
This is the code I use in order to join the 3 tables that are "Users" (IDUser, names and last names), "UserOrgan" (IDUserOrgan, IDUser, IDOrgan)"Organ" (IDOrgan, film, professions).
<%
dim db
dim rs
set db=server.CreateObject("ADODB.Connection")
db.Open Application("DLS_DSN")
set rs = server.CreateObject("ADODB.RecordSet")
rs.Open "select * from Users, UserOrgan, Organ where Organ.OrganID = UserOrgan.OrganID and Users.UserID = UserOrgan.UserID and OrganName = 'ATTORI' ORDER BY LastName,FirstName" ,db,adOpenKeyset,adLockReadOnly
Do while NOT RS.EOF
if rs.eof then
response.write "<scr" & "ipt>" & vbcrlf
response.write "window.close()" & vbcrlf
response.write "</scr" & "ipt>" & vbcrlf
response.end
end if
%>
Maybe I can performe better the query ... maybe ...
Anyway thanks,
Laura
BTW How I can count the rows exit from the selection
... but I do not succeed to understand how to proceed in order to obtain all the present recurrences in "OrganName".
In the database I use OrganName in order to select the condition "they must be ACTORS" but some of they are also "DIRECTORS" "ENTREPRENEURS" etcc; and in the "cell" of output it only exits with the voice "ACTORS"
If I eliminate "OrganName = ' ACTORS' I find 3 or 4 times the same persons in directory (tidy directory for last name and first name)
Instead I would like to find FOR SINGLE PERSON the various corresponding voices ... (I mean John | Smith | The STARMAN | Actor, Bussinessman, Manager ...).
How do make it?
This is the code I use in order to join the 3 tables that are "Users" (IDUser, names and last names), "UserOrgan" (IDUserOrgan, IDUser, IDOrgan)"Organ" (IDOrgan, film, professions).
<%
dim db
dim rs
set db=server.CreateObject("ADODB.Connection")
db.Open Application("DLS_DSN")
set rs = server.CreateObject("ADODB.RecordSet")
rs.Open "select * from Users, UserOrgan, Organ where Organ.OrganID = UserOrgan.OrganID and Users.UserID = UserOrgan.UserID and OrganName = 'ATTORI' ORDER BY LastName,FirstName" ,db,adOpenKeyset,adLockReadOnly
Do while NOT RS.EOF
if rs.eof then
response.write "<scr" & "ipt>" & vbcrlf
response.write "window.close()" & vbcrlf
response.write "</scr" & "ipt>" & vbcrlf
response.end
end if
%>
Maybe I can performe better the query ... maybe ...
Anyway thanks,
Laura
BTW How I can count the rows exit from the selection