% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF Dim accesspointid, isNewRecord accesspointid = Request.QueryString("id") If accesspointid = "" Or accesspointid = "0" Then isNewRecord = True accesspointid = 0 Else isNewRecord = False End If ' If editing, fetch existing data Dim rs, accesspointname, modelid, serialnumber, ipaddress, description, maptop, mapleft, isactive Dim vendorname, modelnumber If Not isNewRecord Then Dim strSQL strSQL = "SELECT s.*, m.modelnumber, v.vendor " & _ "FROM accesspoints s " & _ "LEFT JOIN models m ON s.modelid = m.modelnumberid " & _ "LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _ "WHERE s.apid = " & accesspointid Set rs = objConn.Execute(strSQL) If rs.EOF Then Response.Write("Access Point not found") Response.End End If accesspointname = rs("apname") modelid = rs("modelid") serialnumber = rs("serialnumber") ipaddress = rs("ipaddress") description = rs("description") maptop = rs("maptop") mapleft = rs("mapleft") isactive = rs("isactive") vendorname = rs("vendor") modelnumber = rs("modelnumber") rs.Close Set rs = Nothing Else ' New record defaults accesspointname = "" modelid = "" serialnumber = "" ipaddress = "" description = "" maptop = "" mapleft = "" isactive = 1 ' Active by default for new records vendorname = "" modelnumber = "" End If %>