This is the select statement I'm currently using but I can't seem to get the browser to show any data. It just shows the table structure.I use the g and the p as aliases. Easier maintenance this way.strSQL = "SELECT g.GuestID, g.ProgramID, p.ProgramID AS Expr1, g.GuestName, g.GuestDescription, p.URL, p.Description FROM dbo.T_ProgramGuests g INNER JOIN dbo.T_ProgramLinks p ON g.GuestID = p.LinkID WHERE p.ProgramID = " & Request("ProgramID")
I have an ASP page where the above sql code is embedded. I have two SQL tables. One is called T_ProgramGuests and the other is called T_ProgramLinks. The asp page basically does a read only of the two tables and is suppose to return the results inside of the html tables I have in the asp page. But all I see when I test is the html and the tables are devoid of data.HERE IS THE PAGE CODE:<%on error resume next set con = Server.CreateObject("ADODB.Connection") con.Open "File Name=E:\webservice\Company\Company.UDL" set recProgram = Server.CreateObject("ADODB.Recordset")strSQL = "SELECT g.GuestID, g.ProgramID, p.ProgramID AS Expr1, g.GuestName, g.GuestDescription, p.URL, p.Description FROM dbo.T_ProgramGuests g INNER JOIN dbo.T_ProgramLinks p ON g.GuestID = p.LinkID WHERE p.ProgramID = " & Request("ProgramID")recProgram.Open strSQL,con%><TABLE border="1" cellspacing="0" border="1" width="70%"><p><b>Guest Name and Description:</b></p> <tr> <th width="35%" align="left">Guest Name</th> <th width="45%" align="left">Guest Description</th> <tr> <TD headers="t2"><%=recProgram.Fields("GuestName")%></TD> <TD headers="t3"><%=recProgram.Fields("GuestDescription")%></TD> </tr></table><TABLE border="1" cellspacing="0" border="1" width="70%"><br /><br /><p><b>URL and Description:</b></p> <tr> <th width="35%" align="left">URL</th> <th width="45%" align="left">Description</th> <tr> <TD headers="t4"><%=recProgram.Fields("URL")%></TD> <TD headers="t5"><%=recProgram.Fields("Description")%></TD><%'recProgram.Closecon.Closeset recProgram = nothingset con = nothing'response.write err.Description%> </body></html>
I am new to using the advanced features of SQL and could sure use some help with this.