%@ Language=VBScript %> <% if Session("user_name") = "" then Response.Redirect "Index.asp" end if action ="Fleet2.asp" If Session("STATUS") = "3" then Session("SQL") = "SELECT * FROM FLEET_USERS WHERE USERS.STATUS <> '0' AND FLEET.STATUS <> '0' ORDER BY FLEET.FLEET_ID" 'Session("SQL") = "SELECT * FROM FLEET INNER JOIN USERS ON FLEET.USER_ID = USERS.USER_ID ORDER BY FLEET.FLEET_ID" 'This works but doesn't work for Fleet2.asp You should be able to figure it out. else Session("SQL") = "SELECT * FROM FLEET_USERS WHERE FLEET_USERS.STATUS <> '0' AND FLEET_USERS.USER_ID = " & Session("USER_ID") & " ORDER BY FLEET_USERS.FLEET_ID" end if title = "FLEET" Session("Search_Page") = Right(Request.ServerVariables("URL"), len(Request.ServerVariables("URL")) - InStrRev(Request.ServerVariables("URL"), "/") ) %>
<%=title%>
<% Set DatabaseConnection = Server.CreateObject("ADODB.Connection") DatabaseConnection.Open Application("Connection1") Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.CursorType = 1 Recordset1.CursorLocation = 2 Recordset1.LockType = 3 Recordset1.ActiveConnection = DatabaseConnection Recordset1.Open Session("SQL"), DatabaseConnection %>