# Entire Connection API usage from Natural

**URL:** <https://techcommunity.softwareag.com/t/entire-connection-api-usage-from-natural/60728>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Other-Addons, Natural-Related-Products, Terminal-Emulation-and-Screen-Scraping\
**Created:** [March 29, 2006, 9:01pm UTC](https://techcommunity.softwareag.com/t/entire-connection-api-usage-from-natural/60728 "2006-03-29T21:01:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Brice](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@Mike\_Brice](https://techcommunity.softwareag.com/u/Mike_Brice)\
**Post date:** [March 29, 2006, 9:01pm UTC](https://techcommunity.softwareag.com/t/entire-connection-api-usage-from-natural/60728/1 "2006-03-29T21:01:00Z")

</div>

I would like to use the Entire Connection ActiveX control in a Natural V6 session on Windows to drive a terminal session. Is this possible ? I have tried a few basic method invocations but am clearly missing something basic as nothing appears to work.

For example I try the GetAvailableSessions with the following code fragment:

PROCESS GUI ACTION \<\>  
WITH #OCX-1 #SessionNames #DefName  
USING #Result  
/\*  
write ‘Result:’ #Result /  
‘Sessions:’ /  
#SessionNames (al=64) /  
‘Session count:’ #DefName

The result value is always 20. I have a terminal session active and logged on to CICS but still I receive the error. I have determined that this error code indicates “API\_ERROR\_NOT\_CONNECTED” as shown in the ECAPI.H file.

Any suggestions ?

---

<div class="post-metadata">

**Author:** ![Chad\_Scott](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@Chad\_Scott](https://techcommunity.softwareag.com/u/Chad_Scott)\
**Post date:** [March 30, 2006, 9:36pm UTC](https://techcommunity.softwareag.com/t/entire-connection-api-usage-from-natural/60728/2 "2006-03-30T21:36:52Z")

</div>

Hi Mike,

I haven’t played with the Connection controls from Natural, but when using other ActiveX controls a method would use:  
Send “GetAvailableSessions” To #E-C-Application With #SessionNames #DefName Return #Result

I see that the Component Browser gives examples using the Process Gui Action, but unless you are using it as an embeded object I would try the Send method.

Please let me know if this helps &/or works,  
Chad.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/entire-connection-api-usage-from-natural/60728/3 "2021-04-02T14:40:32Z")

</div>


