<% @LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% Server.ScriptTimeout = 3600 %> <% dim command dim filename command = Request("command") filename = Request("filename") dim privileged privileged = session("privileged") = 1 if privileged = false then response.redirect("http://www.machinedevice.com/index.htm") end if dim dsn dim objConn dim captionObj dim id dim shortcaption dim longcaption dsn="DBQ=" & Server.Mappath("md.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open dsn Set captionObj = Server.CreateObject("ADODB.Recordset") if command = "caption" then captionObj.Open "select * from caption where filename = '" & filename & "'", objConn if not captionObj.EOF then id = captionObj("id") shortcaption = captionObj("shortcaption") longcaption = captionObj("longcaption") else id = 0 shortcaption = "" longcaption = "" end if elseif command = "Save" then shortcaption = request("shortcaption") longcaption = request("longcaption") captionObj.Open "select * from caption where filename = '" & filename & "'", objConn, adOpenKeyset, adLockPessimistic if captionObj.EOF then captionObj.AddNew end if captionObj("filename") = filename captionObj("shortcaption") = shortcaption captionObj("longcaption") = longcaption captionObj.Update command = "Saved" end if set captionObj = nothing objConn.close set objConn = nothing %> Machine Device - Caption Admin <% if command = "Cancel" or command = "Saved" then %> Hit refresh to return to Gallery <% else %>
Caption Admin

Filename: <%=filename%>

ID: <%=id%>

Short Caption: 

Long Caption: 

<%end if %> <% function cint0(str) dim val on error resume next val = cint(str) if err.number <> 0 then val = 0 end if cint0 = val on error goto 0 end function %>