Hello I am trying to connect to one database but get data from two tables I can get the data from one table with no problems but I cant seem to get the data from the second table...
here is the code:
Thanks For all help![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
here is the code:
Code:
<%@ language="JScript"%>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="script.js"></script>
<%
var moo = Request.Form("Location")
conn = Server.CreateObject("ADODB.Connection")
conn.Open("DSN=info")
var recordSet1 = Server.CreateObject("ADODB.Recordset");
var recordSet2 = Server.CreateObject("ADODB.Recordset");
recordSet1.Open("SELECT * from LocNotes"+" where Location ='" + moo + "'", conn);
%>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body topmargin="0" bgcolor="#FFFFFF">
<center>
<img src="Images/banner.jpg">
</center>
<br>
</div>
<div class="InfoMainDIV" align="center">
<h1><%=moo%></h1>
<div id="choice">
<table border="1" width="100%" bgcolor="#CCCCCC" bordercolor="#000000" cellpadding="3" cellspacing="3">
<tr>
<th bgcolor="#666666"><font color="#FFFFFF">Copier </font></th>
<th bgcolor="#666666"><font color="#FFFFFF">Wireless </font></th>
<th bgcolor="#666666"><font color="#FFFFFF">Phone Numbers</font></th>
<th bgcolor="#666666"><font color="#FFFFFF">Machines</font></th>
<th bgcolor="#666666"><font color="#FFFFFF">Users</font></th>
</tr>
<%
while(!recordSet1.EOF)
{
location = recordSet1("Location")
recordSet2.Open("SELECT * from Data"+" where Location ='" + location + "'", conn);
Response.Write(recordset2("FirstName"));
Response.Write("<tr>")
Response.Write("<td bgcolor='#000066'><font color='#FFFFFF'>" + recordSet1("Copier") + "</font></td>");
Response.Write("<td bgcolor='#000066'><font color='#FFFFFF'>" + recordSet1("Wireless") + "</font></td>");
Response.Write("<td bgcolor='#000066'><font color='#FFFFFF'>" + recordSet1("PhoneNumbers") + "</font></td>");
Response.Write("<td bgcolor='#000066'><font color='#FFFFFF'>" + recordSet1("Machines") + "</font></td>");
Response.Write("<td bgcolor='#000066'><font color='#FFFFFF'>" + recordSet2("Device") + "</font></td>");
Response.Write("</tr>");
Response.Write("ddddd")
Response.Write(location + "= location")
recordSet2.Close();
recordSet1.MoveNext();
}
%>
</script>
</table>
</div>
</body>
</html>
Thanks For all help