Fix displaysubnet.asp PC lookup to use Phase 2 schema
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 <noreply@anthropic.com>
This commit is contained in:
@@ -43,17 +43,19 @@
|
|||||||
rsPrinterCheck.Close
|
rsPrinterCheck.Close
|
||||||
Set rsPrinterCheck = Nothing
|
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
|
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))
|
Set rsPCCheck = ExecuteParameterizedQuery(objConn, strPCSQL, Array(search))
|
||||||
IF NOT rsPCCheck.EOF THEN
|
IF NOT rsPCCheck.EOF THEN
|
||||||
Dim pcRedirectId
|
Dim pcRedirectId
|
||||||
pcRedirectId = rsPCCheck("pcid")
|
pcRedirectId = rsPCCheck("machineid")
|
||||||
rsPCCheck.Close
|
rsPCCheck.Close
|
||||||
Set rsPCCheck = Nothing
|
Set rsPCCheck = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
Response.Redirect("./displaypc.asp?pcid=" & pcRedirectId)
|
Response.Redirect("./displaypc.asp?machineid=" & pcRedirectId)
|
||||||
Response.End
|
Response.End
|
||||||
END IF
|
END IF
|
||||||
rsPCCheck.Close
|
rsPCCheck.Close
|
||||||
|
|||||||
Reference in New Issue
Block a user