SimpleASP

From Pickwiki
Revision as of 23:48, 26 February 2015 by Conversion script (talk) (link fix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
<html><head> <title>My first ASP Test</title></head>

<body>

<h3>Test Submitting a UV Command</h3>
<form action="index.asp"  name="Testfrm" method=post>
<input type=text name="uvcommand" value="SORT VOC">
<input type=submit>
</form>
<%
 if request.form("uvcommand") <> "" then
    Dim Sess, UVCommand, [[TheCommand]], Text
    [[TheCommand]] = request.form("uvcommand")
    'the below line just there so you know something is happening, you don't need it in your final product
    response.write "Command : " & [[TheCommand]] & "<br>"
    Set Sess = [[CreateObject]]("[[UniObjects]].[[UniOaifCtrl]]")
    'change the four below arguments to whatever you need to connect to Universe at your site
    Sess.[[HostName]] = "Machine or IP number"
    Sess.[[UserName]] = "your uv username"
    Sess.[[AccountPath]] = "the account or account path you want to log into"
    Sess.Password = "your uv user password"
    ' Now connect
    Sess.connect
    '
    if Sess.error then
       response.write "<SCRIPT LANGUAGE='[[JavaScript1]].1'>"
       response.write "alert('Cannot connect to Database..." & Sess.ERROR & "')"
       response.write "</SCRIPT>"
       response.write "<h1>[" & Sess.hostname & "] - Database Error</h1>"
    else
       response.write "UV Session is active...<br>"
       ' To issue a command
       set UVCommand = Sess.Command
       UVCommand.Text = [[TheCommand]]
       UVCommand.Exec
       ' Now write the output of the universe command, back to the web page !! (exciting!)
       Response.Write UVCommand.Response
    end if
 end if
%>
</body>
</html>