From Pickwiki
Jump to navigationJump to search
<html><head> <title>My first ASP Test</title></head>


<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>
 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
    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>"
       response.write "UV Session is active...<br>"
       ' To issue a command
       set UVCommand = Sess.Command
       UVCommand.Text = [[TheCommand]]
       ' Now write the output of the universe command, back to the web page !! (exciting!)
       Response.Write UVCommand.Response
    end if
 end if