Calling HyperACCESS from an ASP web page.
You can get HAWin32 working properly under active server pages by following the code sample below. This code creates a page with a button on it that will launch HAWin32 when clicked:
Sample Code:
<html>
<head>
<title>HAWin32 Active Server Page Test</title>
</head>
<body bgcolor=”#000000″ text=”#FFFFFF”>
<h2 align=”left”><font color=”#0000FF”>HyperACCESS Active Server Page Test Page</font></h2>
<% if Request.Form(“FormProcessed”) <> 1 then %>
<p align=”left”>This page test HAWin32’s ability to be run from an Active Server Page.</p>
<form method=”POST” action=”h32test.asp” name=”PingInfo”>
<input type=”hidden” name=”FormProcessed” value=”1″><p><input
type=”submit” value=”Start HAWin32″ name=”B1″></p>
</form>
<p>Copyright c 1999 Hilgraeve Inc.</p>
<%
else
Set haAuto = Server.CreateObject(“HAWin32”)
Set haScript = haAuto.haInitialize(“ASPTest”)
retval = haScript.haSetDisplay(1)
if retval = 0 Then
Response.Write “<pre>HAWin32 Test Passed</pre>”
haScript.haTerminate()
else
Response.Write “<pre>HAWin32 Test Failed – Retval=” + CStr(retval) + “</pre>”
End If
Set haAuto = nothing
Set haScript = nothing
End If
%>
</body>
</html>
End of sample code: