Link to home
Start Free TrialLog in
Avatar of hbojorquezgeek
hbojorquezgeek

asked on

Dreamweaver ASP and MSSQL--- multiple query problem

When I run the following query in  the Query Analyzer I get correct values

SELECT dbo.tutee.idratuteeid,dbo.tutee.firstname,dbo.tutee.lastname,dbo.tutee.mi,dbo.tutee.gradelevel,dbo.tutee.room,dbo.tutee.elemteacherid,dbo.elemteacher.elemteacherid,dbo.elemteacher.firstname,dbo.elemteacher.lastname
FROM dbo.tutee, dbo.elemteacher
WHERE dbo.elemteacher.elemteacherid=dbo.tutee.elemteacherid

 AND dbo.tutee.teachercoordid =101


When Dreamweaver's ASP repeated regions behavior codes it like this..

          <td><%=(Recordset1.Fields.Item("idratuteeid").Value)%></td>
          <td><%=(Recordset1.Fields.Item("firstname").Value)%></td>
          <td><%=(Recordset1.Fields.Item("lastname").Value)%></td>
          <td><%=(Recordset1.Fields.Item("mi").Value)%></td>
          <td><%=(Recordset1.Fields.Item("gradelevel").Value)%></td>
          <td><%=(Recordset1.Fields.Item("room").Value)%></td>
          <td><%=(Recordset1.Fields.Item("elemteacherid").Value)%></td>
          <td><%=(Recordset1.Fields.Item("elemteacherid").Value)%></td>
          <td><%=(Recordset1.Fields.Item("firstname").Value)%></td>
          <td><%=(Recordset1.Fields.Item("lastname").Value)%></td>

The firstname and lastname values come from the same table which is BAD!!!
What can I add to the Dreamweaver ASP code  to call from the correct tables.
Since I am a dumb dumb...I tried
          <td><%=(Recordset1.Fields.Item("dbo.elemteacher.lastname").Value)%></td>

and got a an error.

Obviously one of the problems is that the column names in the separate tables are the same...firstname, lastname...
1. Should I have named the differently?
2.  Is there a way for Dreamwever's ASP to differentiate between dbo.elemteacher.lastname and dbo.tutee.lastname

Thanks
ASKER CERTIFIED SOLUTION
Avatar of BillAn1
BillAn1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hbojorquezgeek
hbojorquezgeek

ASKER

First...if I could I would bear your children!!!
Thank you...I am an obvious beginner at SQL and had no idea that I could do that... I've learned so much from this place about triggers and etc...THANKS!
You so rock.
thanks I'm sure ?!
just don't forget to close out on a Question if you have the answer :-)