diff --git a/displaysubnet.asp b/displaysubnet.asp index b97a848..c61939c 100644 --- a/displaysubnet.asp +++ b/displaysubnet.asp @@ -43,17 +43,19 @@ rsPrinterCheck.Close Set rsPrinterCheck = Nothing - ' Check if this IP belongs to a PC + ' Check if this IP belongs to a PC (Phase 2: uses communications table) Dim rsPCCheck, strPCSQL - strPCSQL = "SELECT pcid FROM pc_network_interfaces WHERE ipaddress = ?" + strPCSQL = "SELECT m.machineid FROM machines m " & _ + "INNER JOIN communications c ON m.machineid = c.machineid " & _ + "WHERE c.address = ? AND m.pctypeid IS NOT NULL AND c.isactive = 1" Set rsPCCheck = ExecuteParameterizedQuery(objConn, strPCSQL, Array(search)) IF NOT rsPCCheck.EOF THEN Dim pcRedirectId - pcRedirectId = rsPCCheck("pcid") + pcRedirectId = rsPCCheck("machineid") rsPCCheck.Close Set rsPCCheck = Nothing objConn.Close - Response.Redirect("./displaypc.asp?pcid=" & pcRedirectId) + Response.Redirect("./displaypc.asp?machineid=" & pcRedirectId) Response.End END IF rsPCCheck.Close