% @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 %>