Update pages to use pctypeid instead of machinetypeid IN (33-43)

- PCs identified by pctypeid IS NOT NULL instead of machinetypeid list
- Equipment identified by pctypeid IS NULL instead of NOT IN list
- Fixed devicecamera.asp: IDF dropdown uses machinetypeid 17, not 34
- Fixed displaypcs.asp: measuring tool filter uses pctypeid = 7

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-08 15:46:48 -05:00
parent e2e7cb1466
commit 659e8bad4b
18 changed files with 26 additions and 26 deletions

View File

@@ -402,7 +402,7 @@
<option value="">-- None --</option> <option value="">-- None --</option>
<% <%
Dim rsControlPCs Dim rsControlPCs
strSQL = "SELECT machineid, machinenumber, hostname FROM machines WHERE machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) AND isactive = 1 ORDER BY machinenumber ASC" strSQL = "SELECT machineid, machinenumber, hostname FROM machines WHERE pctypeid IS NOT NULL AND isactive = 1 ORDER BY machinenumber ASC"
Set rsControlPCs = objconn.Execute(strSQL) Set rsControlPCs = objconn.Execute(strSQL)
While Not rsControlPCs.EOF While Not rsControlPCs.EOF
Dim controlPCDisplay Dim controlPCDisplay

10
api.asp
View File

@@ -257,7 +257,7 @@ Sub UpdateCompleteAsset()
' Check if PC exists ' Check if PC exists
Dim strSQL, rsResult, safeHostname, safeSerial Dim strSQL, rsResult, safeHostname, safeSerial
safeHostname = Replace(hostname, "'", "''") safeHostname = Replace(hostname, "'", "''")
strSQL = "SELECT machineid FROM machines WHERE hostname = '" & safeHostname & "' AND machinetypeid IN (33,34,35,36,37,38,39,40,41,42,43)" strSQL = "SELECT machineid FROM machines WHERE hostname = '" & safeHostname & "' AND pctypeid IS NOT NULL"
Set rsResult = objConn.Execute(strSQL) Set rsResult = objConn.Execute(strSQL)
If Err.Number <> 0 Then If Err.Number <> 0 Then
SendError debugMsg & "8-PC check failed: " & Err.Description SendError debugMsg & "8-PC check failed: " & Err.Description
@@ -850,7 +850,7 @@ Function InsertOrUpdatePC(conn, hostname, serialnumber, manufacturer, model, pcT
' Check if PC already exists (Phase 2: identify PCs by machinetypeid 33,34,35) ' Check if PC already exists (Phase 2: identify PCs by machinetypeid 33,34,35)
Dim strSQL, rsResult, safeHostname Dim strSQL, rsResult, safeHostname
safeHostname = Replace(hostname, "'", "''") safeHostname = Replace(hostname, "'", "''")
strSQL = "SELECT machineid FROM machines WHERE hostname = '" & safeHostname & "' AND machinetypeid IN (33,34,35,36,37,38,39,40,41,42,43)" strSQL = "SELECT machineid FROM machines WHERE hostname = '" & safeHostname & "' AND pctypeid IS NOT NULL"
Set rsResult = objConn.Execute(strSQL) Set rsResult = objConn.Execute(strSQL)
Dim machineid Dim machineid
@@ -928,7 +928,7 @@ Function InsertOrUpdatePC(conn, hostname, serialnumber, manufacturer, model, pcT
"osid = " & sqlOsId & ", " & _ "osid = " & sqlOsId & ", " & _
"machinestatusid = " & sqlStatusId & ", " & _ "machinestatusid = " & sqlStatusId & ", " & _
"lastupdated = NOW() " & _ "lastupdated = NOW() " & _
"WHERE machineid = " & CLng(machineid) & " AND machinetypeid IN (33,34,35,36,37,38,39,40,41,42,43)" "WHERE machineid = " & CLng(machineid) & " AND pctypeid IS NOT NULL"
LogToFile "UPDATE SQL built: " & Left(strSQL, 200) & "..." LogToFile "UPDATE SQL built: " & Left(strSQL, 200) & "..."
@@ -1034,7 +1034,7 @@ Function GetMachineidByHostname(hostname)
Dim strSQL, rsResult, safeHostname Dim strSQL, rsResult, safeHostname
safeHostname = Replace(hostname, "'", "''") safeHostname = Replace(hostname, "'", "''")
strSQL = "SELECT machineid FROM machines WHERE hostname = '" & safeHostname & "' AND machinetypeid IN (33,34,35,36,37,38,39,40,41,42,43)" strSQL = "SELECT machineid FROM machines WHERE hostname = '" & safeHostname & "' AND pctypeid IS NOT NULL"
Set rsResult = objConn.Execute(strSQL) Set rsResult = objConn.Execute(strSQL)
If Not rsResult.EOF Then If Not rsResult.EOF Then
@@ -1340,7 +1340,7 @@ Function CreatePCMachineRelationship(pcMachineid, machineNumber)
' Find equipment by machine number (Phase 2: PCs are machinetypeid 33-43, Equipment is 1-32) ' Find equipment by machine number (Phase 2: PCs are machinetypeid 33-43, Equipment is 1-32)
Dim strSQL, rsResult, safeMachineNumber Dim strSQL, rsResult, safeMachineNumber
safeMachineNumber = Replace(machineNumber, "'", "''") safeMachineNumber = Replace(machineNumber, "'", "''")
strSQL = "SELECT machineid FROM machines WHERE machinenumber = '" & safeMachineNumber & "' AND machinetypeid NOT IN (33,34,35,36,37,38,39,40,41,42,43)" strSQL = "SELECT machineid FROM machines WHERE machinenumber = '" & safeMachineNumber & "' AND pctypeid IS NULL"
LogToFile "CreatePCMachineRelationship: Executing SQL: " & strSQL LogToFile "CreatePCMachineRelationship: Executing SQL: " & strSQL
Set rsResult = objConn.Execute(strSQL) Set rsResult = objConn.Execute(strSQL)

View File

@@ -133,7 +133,7 @@ Set rsStatus = Nothing
"LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _ "LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _
"LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _ "LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _
"LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _ "LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _
"WHERE m.isactive = 1 AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters ' Apply filters
whereClause = "" whereClause = ""

View File

@@ -161,7 +161,7 @@
<option value="">-- Select IDF --</option> <option value="">-- Select IDF --</option>
<% <%
Dim strSQL2, rsIDFs Dim strSQL2, rsIDFs
strSQL2 = "SELECT machineid, alias AS idfname FROM machines WHERE machinetypeid = 34 AND isactive = 1 ORDER BY alias" strSQL2 = "SELECT machineid, alias AS idfname FROM machines WHERE machinetypeid = 17 AND isactive = 1 ORDER BY alias"
Set rsIDFs = objConn.Execute(strSQL2) Set rsIDFs = objConn.Execute(strSQL2)
If rsIDFs.EOF Then If rsIDFs.EOF Then

View File

@@ -419,7 +419,7 @@ End If
"JOIN machines m ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) " & _ "JOIN machines m ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) " & _
"LEFT JOIN communications c ON m.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _ "LEFT JOIN communications c ON m.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _
"WHERE (mr.machineid = ? OR mr.related_machineid = ?) AND mr.relationshiptypeid = 3 " & _ "WHERE (mr.machineid = ? OR mr.related_machineid = ?) AND mr.relationshiptypeid = 3 " & _
" AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) AND m.machineid <> ? AND mr.isactive = 1 " & _ " AND m.pctypeid IS NOT NULL AND m.machineid <> ? AND mr.isactive = 1 " & _
"GROUP BY m.machineid, m.machinenumber, m.hostname" "GROUP BY m.machineid, m.machinenumber, m.hostname"
Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid)) Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid))

View File

@@ -101,7 +101,7 @@
"LEFT JOIN functionalaccounts ON machinetypes.functionalaccountid = functionalaccounts.functionalaccountid " & _ "LEFT JOIN functionalaccounts ON machinetypes.functionalaccountid = functionalaccounts.functionalaccountid " & _
"INNER JOIN vendors ON models.vendorid = vendors.vendorid " & _ "INNER JOIN vendors ON models.vendorid = vendors.vendorid " & _
"LEFT JOIN printers ON machines.printerid = printers.printerid " & _ "LEFT JOIN printers ON machines.printerid = printers.printerid " & _
"WHERE machines.machineid = " & CLng(machineid) & " AND machines.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE machines.machineid = " & CLng(machineid) & " AND machines.pctypeid IS NOT NULL"
Set rs = objConn.Execute(strSQL) Set rs = objConn.Execute(strSQL)
@@ -502,7 +502,7 @@ End If
"LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _
"LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _
"WHERE (mr.machineid = ? OR mr.related_machineid = ?) AND mr.relationshiptypeid = 3 " & _ "WHERE (mr.machineid = ? OR mr.related_machineid = ?) AND mr.relationshiptypeid = 3 " & _
" AND m.machinetypeid NOT IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) AND m.machineid <> ? AND mr.isactive = 1 " & _ " AND m.pctypeid IS NULL AND m.machineid <> ? AND mr.isactive = 1 " & _
"ORDER BY machinenumber" "ORDER BY machinenumber"
Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid)) Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid))

View File

@@ -48,7 +48,7 @@ deviceTypeFilter = Request.QueryString("devicetype")
Dim rsUnlinked, unlinkedCount Dim rsUnlinked, unlinkedCount
unlinkedCount = 0 unlinkedCount = 0
Set rsUnlinked = objConn.Execute("SELECT COUNT(*) as cnt FROM machines m " & _ Set rsUnlinked = objConn.Execute("SELECT COUNT(*) as cnt FROM machines m " & _
"WHERE m.machinetypeid IN (41, 42, 43) AND m.isactive = 1 " & _ "WHERE m.pctypeid = 7 AND m.isactive = 1 " & _
"AND NOT EXISTS (SELECT 1 FROM machinerelationships mr WHERE (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.relationshiptypeid = 3 AND mr.isactive = 1)") "AND NOT EXISTS (SELECT 1 FROM machinerelationships mr WHERE (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.relationshiptypeid = 3 AND mr.isactive = 1)")
If Not rsUnlinked.EOF Then If Not rsUnlinked.EOF Then
unlinkedCount = CLng(rsUnlinked("cnt") & "") unlinkedCount = CLng(rsUnlinked("cnt") & "")
@@ -141,7 +141,7 @@ Set rsStatus = Nothing
"LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _ "LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _
"LEFT JOIN machinerelationships mr ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.isactive = 1 AND mr.relationshiptypeid = 3 " & _ "LEFT JOIN machinerelationships mr ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.isactive = 1 AND mr.relationshiptypeid = 3 " & _
"LEFT JOIN machines eq ON (eq.machineid = mr.related_machineid OR eq.machineid = mr.machineid) AND eq.machineid <> m.machineid AND eq.machinetypeid < 33 " & _ "LEFT JOIN machines eq ON (eq.machineid = mr.related_machineid OR eq.machineid = mr.machineid) AND eq.machineid <> m.machineid AND eq.machinetypeid < 33 " & _
"WHERE m.isactive = 1 AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters ' Apply filters
whereClause = "" whereClause = ""
@@ -162,7 +162,7 @@ Set rsStatus = Nothing
' Filter for specialized PCs needing equipment relationships ' Filter for specialized PCs needing equipment relationships
If needsRelationshipFilter = "1" Then If needsRelationshipFilter = "1" Then
whereClause = whereClause & "AND m.machinetypeid IN (41, 42, 43) " & _ whereClause = whereClause & "AND m.pctypeid = 7 " & _
"AND NOT EXISTS (SELECT 1 FROM machinerelationships mr WHERE (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.relationshiptypeid = 3 AND mr.isactive = 1) " "AND NOT EXISTS (SELECT 1 FROM machinerelationships mr WHERE (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) AND mr.relationshiptypeid = 3 AND mr.isactive = 1) "
End If End If

View File

@@ -27,7 +27,7 @@
'-------------------------------------------------------Is this the IP address of a PC--------------------------------------------------- '-------------------------------------------------------Is this the IP address of a PC---------------------------------------------------
IF search <> "" THEN IF search <> "" THEN
' PHASE 2: Query communications table instead of pc_network_interfaces ' PHASE 2: Query communications table instead of pc_network_interfaces
strSQL = "SELECT c.machineid FROM communications c JOIN machines m ON c.machineid = m.machineid WHERE c.address='" &search &"' AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) LIMIT 1" strSQL = "SELECT c.machineid FROM communications c JOIN machines m ON c.machineid = m.machineid WHERE c.address='" &search &"' AND m.pctypeid IS NOT NULL LIMIT 1"
set rs = objconn.Execute(strSQL) set rs = objconn.Execute(strSQL)
IF NOT rs.EOF THEN IF NOT rs.EOF THEN
machineid = rs("machineid") machineid = rs("machineid")

View File

@@ -34,7 +34,7 @@
"LEFT JOIN vendors v ON mo.vendorid = v.vendorid " &_ "LEFT JOIN vendors v ON mo.vendorid = v.vendorid " &_
"LEFT JOIN businessunits bu ON m.businessunitid = bu.businessunitid " &_ "LEFT JOIN businessunits bu ON m.businessunitid = bu.businessunitid " &_
"LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " &_ "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " &_
"WHERE m.machineid = ? AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.machineid = ? AND m.pctypeid IS NOT NULL"
Dim cmd, rsMachine Dim cmd, rsMachine
Set cmd = Server.CreateObject("ADODB.Command") Set cmd = Server.CreateObject("ADODB.Command")

View File

@@ -559,7 +559,7 @@
<option value="">-- None --</option> <option value="">-- None --</option>
<% <%
Dim rsControlPCs Dim rsControlPCs
strSQL = "SELECT machineid, machinenumber, hostname FROM machines WHERE machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) AND isactive = 1 ORDER BY machinenumber ASC" strSQL = "SELECT machineid, machinenumber, hostname FROM machines WHERE pctypeid IS NOT NULL AND isactive = 1 ORDER BY machinenumber ASC"
Set rsControlPCs = objconn.Execute(strSQL) Set rsControlPCs = objconn.Execute(strSQL)
While Not rsControlPCs.EOF While Not rsControlPCs.EOF
Dim controlPCDisplay, selectedControlPC Dim controlPCDisplay, selectedControlPC

View File

@@ -34,7 +34,7 @@
"LEFT JOIN vendors v ON mo.vendorid = v.vendorid " &_ "LEFT JOIN vendors v ON mo.vendorid = v.vendorid " &_
"LEFT JOIN businessunits bu ON m.businessunitid = bu.businessunitid " &_ "LEFT JOIN businessunits bu ON m.businessunitid = bu.businessunitid " &_
"LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " &_ "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " &_
"WHERE m.machineid = ? AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.machineid = ? AND m.pctypeid IS NOT NULL"
Dim cmd, rsMachine Dim cmd, rsMachine
Set cmd = Server.CreateObject("ADODB.Command") Set cmd = Server.CreateObject("ADODB.Command")

View File

@@ -133,7 +133,7 @@ Set rsStatus = Nothing
"LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _ "LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _
"LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _ "LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _
"LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _ "LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _
"WHERE m.isactive = 1 AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters ' Apply filters
whereClause = "" whereClause = ""

View File

@@ -570,7 +570,7 @@
<option value="">-- None --</option> <option value="">-- None --</option>
<% <%
Dim rsControlPCs Dim rsControlPCs
strSQL = "SELECT machineid, machinenumber, hostname FROM machines WHERE machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) AND isactive = 1 ORDER BY machinenumber ASC" strSQL = "SELECT machineid, machinenumber, hostname FROM machines WHERE pctypeid IS NOT NULL AND isactive = 1 ORDER BY machinenumber ASC"
Set rsControlPCs = objconn.Execute(strSQL) Set rsControlPCs = objconn.Execute(strSQL)
While Not rsControlPCs.EOF While Not rsControlPCs.EOF
Dim controlPCDisplay, selectedControlPC Dim controlPCDisplay, selectedControlPC

View File

@@ -133,7 +133,7 @@ Set rsStatus = Nothing
"LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _ "LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _
"LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _ "LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _
"LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _ "LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _
"WHERE m.isactive = 1 AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters ' Apply filters
whereClause = "" whereClause = ""

View File

@@ -133,7 +133,7 @@ Set rsStatus = Nothing
"LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _ "LEFT JOIN communications c ON c.machineid = m.machineid AND c.isprimary = 1 " & _
"LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _ "LEFT JOIN pctype ON m.pctypeid = pctype.pctypeid " & _
"LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _ "LEFT JOIN machinestatus ON m.machinestatusid = machinestatus.machinestatusid " & _
"WHERE m.isactive = 1 AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" "WHERE m.isactive = 1 AND m.pctypeid IS NOT NULL"
' Apply filters ' Apply filters
whereClause = "" whereClause = ""

View File

@@ -20,7 +20,7 @@
' Check if serial number already exists - PHASE 2: Use machines table ' Check if serial number already exists - PHASE 2: Use machines table
Dim checkSQL, rsCheck, existingMachineID Dim checkSQL, rsCheck, existingMachineID
checkSQL = "SELECT machineid FROM machines WHERE serialnumber = ? AND machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" checkSQL = "SELECT machineid FROM machines WHERE serialnumber = ? AND pctypeid IS NOT NULL"
Set rsCheck = ExecuteParameterizedQuery(objConn, checkSQL, Array(serialnumber)) Set rsCheck = ExecuteParameterizedQuery(objConn, checkSQL, Array(serialnumber))
If Not rsCheck.EOF Then If Not rsCheck.EOF Then

View File

@@ -115,7 +115,7 @@
End If End If
' Add lastupdated timestamp and WHERE clause ' Add lastupdated timestamp and WHERE clause
updateSQL = updateSQL & "lastupdated = NOW() WHERE machineid = ? AND machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" updateSQL = updateSQL & "lastupdated = NOW() WHERE machineid = ? AND pctypeid IS NOT NULL"
paramList(paramIndex) = pcid paramList(paramIndex) = pcid
' Execute parameterized update ' Execute parameterized update

View File

@@ -41,7 +41,7 @@
' Verify the PC exists using parameterized query - PHASE 2: Use machines table ' Verify the PC exists using parameterized query - PHASE 2: Use machines table
Dim checkSQL, rsCheck, cmdCheck Dim checkSQL, rsCheck, cmdCheck
checkSQL = "SELECT COUNT(*) as cnt FROM machines WHERE machineid = ? AND machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" checkSQL = "SELECT COUNT(*) as cnt FROM machines WHERE machineid = ? AND pctypeid IS NOT NULL"
Set cmdCheck = Server.CreateObject("ADODB.Command") Set cmdCheck = Server.CreateObject("ADODB.Command")
cmdCheck.ActiveConnection = objConn cmdCheck.ActiveConnection = objConn
cmdCheck.CommandText = checkSQL cmdCheck.CommandText = checkSQL
@@ -191,7 +191,7 @@
' Build UPDATE statement for PC using parameterized query - PHASE 2: Use machines table ' Build UPDATE statement for PC using parameterized query - PHASE 2: Use machines table
Dim strSQL, cmdUpdate Dim strSQL, cmdUpdate
strSQL = "UPDATE machines SET modelnumberid = ?, machinenumber = ?, lastupdated = NOW() WHERE machineid = ? AND machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)" strSQL = "UPDATE machines SET modelnumberid = ?, machinenumber = ?, lastupdated = NOW() WHERE machineid = ? AND pctypeid IS NOT NULL"
Set cmdUpdate = Server.CreateObject("ADODB.Command") Set cmdUpdate = Server.CreateObject("ADODB.Command")
cmdUpdate.ActiveConnection = objConn cmdUpdate.ActiveConnection = objConn
cmdUpdate.CommandText = strSQL cmdUpdate.CommandText = strSQL