Will,
Similiar to Brian's solution, I use JScript for U2 which utilizes UniObjects from the client instead of from the web server via ASP. This solution assumes that you have UniObjects installed on the client machine and JScript for U2 installed on the web server.
The following HTML code:
<html> <head> <title>JScript for U2 - Min Sample</title> <meta http-equiv="pragma" content="no-cache"></meta> <meta http-equiv="cache-control" content="no-cache"></meta> <meta http-equiv="expires" content="0"></meta>
<script language="javascript1.2">
<!--
var _JS4U2_js_url = "/JS4U2/js/", _JS4U2_html_url = "/JS4U2/html/"; // global variables
document.write('<script language="jscript" src="'+_JS4U2_js_url+'JS4U2.jse"/></scr'+'ipt>');
//-->
</script>
<script language="jscript">
<!--
function onloadEvent() {
U2Session(oSession);
oSession.UserName = "";
oSession.Password = "";
oSession.Hostname = "";
oSession.AccountPath = "";
oSession.ConnectMessage = "Attempting to connect to U2 database. Please wait...";
if (U2ConnectSession(oSession)) {
var msg = "";
msg += "hello world" + "<br/><br/>";
var today = new Date();
var currDate = today.getMonth()+1 + "/" + today.getDate() + "/" + today.getFullYear();
var currTime = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var currMsg = "Hello World";
msg += currMsg + "-" + currDate + "-" + currTime + "<br/><br/>";
msg += U2CallSubroutine(oSession,"HELLO.WORLD.PROGRAM",currMsg,currDate,currTime) + "<br/><br/>";
msg += U2ExecuteCommand(oSession,"LISTUSER") + "<br/><br/>";
document.write(msg);
U2DisconnectSession(oSession);
}
return;
}
// code for HELLO.WORLD.PROGRAM //SUBROUTINE HELLO.WORLD.PROGRAM(ARG1,ARG2,ARG3) //IF UNASSIGNED(ARG1) THEN ARG1 = "" //IF UNASSIGNED(ARG2) THEN ARG2 = "" //IF UNASSIGNED(ARG3) THEN ARG3 = "" //ARG2 = OCONV(ICONV(ARG2,"D"),"D4") //ARG3 = OCONV(ICONV(ARG3,"MT"),"MTS") //PRINT ARG1: " - ":ARG2: " - ": ARG3 //RETURN // end of code for HELLO.WORLD.PROGRAM //-->
</script>
</head>
<body onload="onloadEvent()">
<object id="oSession" classid="clsid:3ED50B8E-0667-11D4-BE19-00104B2A91CE"></object>
</body>
</html>
was used to display a WEB page with the following information:
hello world
Hello World-2/9/2005-10:8:34
HELLO.WORLD.PROGRAM,Hello World,09 Feb 2005,10:08:34
Licensed/Effective # of Users Udt Sql Total 2 / 2 2 0 2 UDTNO USRNBR UID USRNAME USRTYPE TTY IP-ADDRESS TIME DATE 1 3988 0 Administr udt pts/1 192.168.0.100 09:15:54 Feb 09 2005 2 4084 0 Administr udt pts/2 udcs 10:08:34 Feb 09 2005
Regards, Ian Renfrew
----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Wednesday, February 09, 2005 8:24 AM
Subject: Re: [U2] Universe to Web interface
Will,
I still don't get why you want to use a BAT file to do this at all. IF you're using IIS, you should really be using ASP.
The simplest way is to load UniObjects onto the web server, and just use that from some very simple asp code, e.g.:
<html> <body> <% Dim Sess, Subr, Text Set Sess = CreateObject("UniObjects.UniOaifCtrl") Sess.HostName = "localhost" Sess.UserName = "your_user_here" Sess.AccountPath = "your_account_here" Sess.Password = "your_password_here"
' Now connect Sess.Connect
' Set up the subroutine call Set Subr = Sess.Subroutine("Your_Subroutine_Name",1) Subr.Call Text = Subr.GetArg(0)
' Now write the text to the page Response.Write Text %> </body> </html>
Brian ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/