Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : How to show table records, based on another query results? Signup · Login
Author Thread
How to show table records, based on another query results?
Posted in tutorial: Using ASP pages to page through Recordsets
·  engahm
User
Joined: 8 Jun 2003
Total Posts: 1
How to show table records, based on another query results?
Posted: 8 Jun 2003
Hi,
I have a task, I need to generate a table from a variable query!!
Ok, I will make it clearer, I have 2 tables one of them called "Names", the other one called "Employee_Info".

The table "Names" contain one field only, which is "Field_Name", the records stored in that table is:
1. Employee_Age
2. Employee_Name

The other table, which is "Employee_Info" contains the fields "Employee_Name,Employee_Age,Employee_Sex".

Now what I am required to do is to search the first table "Names" and to show the fields of the second table "Emploee_Info" which is stored in the First table "Name".

In the above case, to show Employee_Age, Employee_Name of the "Employee_Info" table, those two fields only will be shown, because they are stored in table "Names".

I hope this is clear, can any one help:

I think this is the solutions, but I have a problem.
// forget about the connection and other codes, here is just the headlines.

SQL = "Select * from Names"
oRss1.open SQL,Connection

SQL = "Select * from Employee_Info"
oRss2.open SQL,Connection

Do While Not oRss2.Eof
   Do While Not oRss1.Eof
      Response.Write(oRss2.Fields(oRss1.Fields("Field_Name")) & "/")
   Loop
   Response.Write("<br>")
   oRss2.MoveNext
Loop


The problem is in the line:
oRss2.Fields(oRss1.Fields("Field_Name"))

I think it shall be something different that oRss1.Fields(""), I think the .Fields shall be replaced with something different.

Can you help,
Thanks
·  zah_se
User
Joined: 14 Sep 2007
Total Posts: 1
this is zaher azam
Posted: 14 Sep 2007
when you recieve this message reply to me ASAP
ZAHER AZAM
zah_se@hotmail.com
http://www.zaher.se

Users Who Have Visited This Thread In Last 24 Hours
2 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.