From dd8729393f0bf8473d89437687afd0e242975899 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Mon, 5 Jan 2026 10:52:44 -0500 Subject: [PATCH] Fix displaysubnet.asp PC lookup to use Phase 2 schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PC IP lookup was using the deprecated pc_network_interfaces table which no longer exists. Updated to use the communications table and machines table with proper Phase 2 joins. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- displaysubnet.asp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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