'vbscript to open HyperACCESS, open a connection, issue a command, and capture the response to a variable
Set haWin32 = CreateObject("HAWin32")
Set haScript = haWin32.haInitialize("test")

cr = Chr(13)

haScript.haSizeHyperACCESS 3
haScript.haOpenSession "session.HAW"
haScript.haConnectSession 0
haScript.haWaitForConnection 1, 100000

haScript.haWaitForPrompt "prompt>"
haScript.haTypeText "some command" & cr

'example: if "some command" returns data like "100 0 0 10 test 0"
'and we want to return 100, 10 and discard the rest of the data.
input = haScript.haGetInput (0, -1, 10000, 10000)
if not input = "" then
data = split(input, " ")
datastr = data(0) & ", " & data(3)
end if
haScript.haTerminate

To execute this sample save the above code as .vbs file. Double click the saved file to execute. HyperACCESS will be opened by the script.

Return to sample script index