Skip to main content

[Migrated content. Thread originally posted on 09 December 2004]

Hi,
I am trying to get an integration together with Lotus Notes
which supports Lotus Script (Very Similar to VB Script) Using the ACUGT Automation Controller - My Problem is the script Runs once
then refuses to run again until I reboot the server, Here is an example of the script.

Please anyone who can help will me much appreciaited

Sub Initialize
On Error Goto errhndlr

Dim PFUNCTION As String
Dim PCOMPANYNUMBER As String
Dim PEMPKEY1 As String
Dim PTRANSACTCODE As String
Dim PDETAIL As String
Dim PERROR As String
Dim cblobj As Variant
Dim retVal As Variant

Print "start"

PFUNCTION= "READ" PEMPKEY1 = "0002728M"
PTRANSACTCODE = "1251"
PCOMPANYNUMBER = "01"

Set cblobj = CreateObject("AcuGT.Application")
If cblobj Is Nothing Then
Print "error - no object created"
Else
Print "success - object created"
cblobj.Initialize "-c F:\\Payday\\payday.cfg" retVal = cblobj.call50("EMPRW.ACU", PFUNCTION, PCOMPANYNUMBER, PEMPKEY1, PTRANSACTCODE, PDETAIL , PERROR ) '
Print "RETURN details => " Cstr(PDETAIL)

cblobj.Cancel ("EMPRW.ACU")
cblobj.Shutdown

End If


If PERROR = "35" Then
PERROR = "Successfull"
End If
Print "PERROR is =>"&PERROR
Exit Sub

errhndlr:
Print "There was an error with the automation object =>(" Error$ ")"
Resume Next

End Sub

[Migrated content. Thread originally posted on 09 December 2004]

Hi,
I am trying to get an integration together with Lotus Notes
which supports Lotus Script (Very Similar to VB Script) Using the ACUGT Automation Controller - My Problem is the script Runs once
then refuses to run again until I reboot the server, Here is an example of the script.

Please anyone who can help will me much appreciaited

Sub Initialize
On Error Goto errhndlr

Dim PFUNCTION As String
Dim PCOMPANYNUMBER As String
Dim PEMPKEY1 As String
Dim PTRANSACTCODE As String
Dim PDETAIL As String
Dim PERROR As String
Dim cblobj As Variant
Dim retVal As Variant

Print "start"

PFUNCTION= "READ" PEMPKEY1 = "0002728M"
PTRANSACTCODE = "1251"
PCOMPANYNUMBER = "01"

Set cblobj = CreateObject("AcuGT.Application")
If cblobj Is Nothing Then
Print "error - no object created"
Else
Print "success - object created"
cblobj.Initialize "-c F:\\Payday\\payday.cfg" retVal = cblobj.call50("EMPRW.ACU", PFUNCTION, PCOMPANYNUMBER, PEMPKEY1, PTRANSACTCODE, PDETAIL , PERROR ) '
Print "RETURN details => " Cstr(PDETAIL)

cblobj.Cancel ("EMPRW.ACU")
cblobj.Shutdown

End If


If PERROR = "35" Then
PERROR = "Successfull"
End If
Print "PERROR is =>"&PERROR
Exit Sub

errhndlr:
Print "There was an error with the automation object =>(" Error$ ")"
Resume Next

End Sub
I don't know Lotus script, but I notice you use STRING datatype? The Automation server interface requires VARIANT datatype for its parameters.

If you look in the sample directory of your ACUCOBOL-GT installation, you will find a directory named autosrv, underneat this there are multiple examples of how to use ACUCOBOL-GT Automation server from Visual Basic.

[Migrated content. Thread originally posted on 09 December 2004]

Hi,
I am trying to get an integration together with Lotus Notes
which supports Lotus Script (Very Similar to VB Script) Using the ACUGT Automation Controller - My Problem is the script Runs once
then refuses to run again until I reboot the server, Here is an example of the script.

Please anyone who can help will me much appreciaited

Sub Initialize
On Error Goto errhndlr

Dim PFUNCTION As String
Dim PCOMPANYNUMBER As String
Dim PEMPKEY1 As String
Dim PTRANSACTCODE As String
Dim PDETAIL As String
Dim PERROR As String
Dim cblobj As Variant
Dim retVal As Variant

Print "start"

PFUNCTION= "READ" PEMPKEY1 = "0002728M"
PTRANSACTCODE = "1251"
PCOMPANYNUMBER = "01"

Set cblobj = CreateObject("AcuGT.Application")
If cblobj Is Nothing Then
Print "error - no object created"
Else
Print "success - object created"
cblobj.Initialize "-c F:\\Payday\\payday.cfg" retVal = cblobj.call50("EMPRW.ACU", PFUNCTION, PCOMPANYNUMBER, PEMPKEY1, PTRANSACTCODE, PDETAIL , PERROR ) '
Print "RETURN details => " Cstr(PDETAIL)

cblobj.Cancel ("EMPRW.ACU")
cblobj.Shutdown

End If


If PERROR = "35" Then
PERROR = "Successfull"
End If
Print "PERROR is =>"&PERROR
Exit Sub

errhndlr:
Print "There was an error with the automation object =>(" Error$ ")"
Resume Next

End Sub
I don't know Lotus script, but I notice you use STRING datatype? The Automation server interface requires VARIANT datatype for its parameters.

If you look in the sample directory of your ACUCOBOL-GT installation, you will find a directory named autosrv, underneat this there are multiple examples of how to use ACUCOBOL-GT Automation server from Visual Basic.

[Migrated content. Thread originally posted on 09 December 2004]

Hi,
I am trying to get an integration together with Lotus Notes
which supports Lotus Script (Very Similar to VB Script) Using the ACUGT Automation Controller - My Problem is the script Runs once
then refuses to run again until I reboot the server, Here is an example of the script.

Please anyone who can help will me much appreciaited

Sub Initialize
On Error Goto errhndlr

Dim PFUNCTION As String
Dim PCOMPANYNUMBER As String
Dim PEMPKEY1 As String
Dim PTRANSACTCODE As String
Dim PDETAIL As String
Dim PERROR As String
Dim cblobj As Variant
Dim retVal As Variant

Print "start"

PFUNCTION= "READ" PEMPKEY1 = "0002728M"
PTRANSACTCODE = "1251"
PCOMPANYNUMBER = "01"

Set cblobj = CreateObject("AcuGT.Application")
If cblobj Is Nothing Then
Print "error - no object created"
Else
Print "success - object created"
cblobj.Initialize "-c F:\\Payday\\payday.cfg" retVal = cblobj.call50("EMPRW.ACU", PFUNCTION, PCOMPANYNUMBER, PEMPKEY1, PTRANSACTCODE, PDETAIL , PERROR ) '
Print "RETURN details => " Cstr(PDETAIL)

cblobj.Cancel ("EMPRW.ACU")
cblobj.Shutdown

End If


If PERROR = "35" Then
PERROR = "Successfull"
End If
Print "PERROR is =>"&PERROR
Exit Sub

errhndlr:
Print "There was an error with the automation object =>(" Error$ ")"
Resume Next

End Sub
I don't know Lotus script, but I notice you use STRING datatype? The Automation server interface requires VARIANT datatype for its parameters.

If you look in the sample directory of your ACUCOBOL-GT installation, you will find a directory named autosrv, underneat this there are multiple examples of how to use ACUCOBOL-GT Automation server from Visual Basic.

[Migrated content. Thread originally posted on 09 December 2004]

Hi,
I am trying to get an integration together with Lotus Notes
which supports Lotus Script (Very Similar to VB Script) Using the ACUGT Automation Controller - My Problem is the script Runs once
then refuses to run again until I reboot the server, Here is an example of the script.

Please anyone who can help will me much appreciaited

Sub Initialize
On Error Goto errhndlr

Dim PFUNCTION As String
Dim PCOMPANYNUMBER As String
Dim PEMPKEY1 As String
Dim PTRANSACTCODE As String
Dim PDETAIL As String
Dim PERROR As String
Dim cblobj As Variant
Dim retVal As Variant

Print "start"

PFUNCTION= "READ" PEMPKEY1 = "0002728M"
PTRANSACTCODE = "1251"
PCOMPANYNUMBER = "01"

Set cblobj = CreateObject("AcuGT.Application")
If cblobj Is Nothing Then
Print "error - no object created"
Else
Print "success - object created"
cblobj.Initialize "-c F:\\Payday\\payday.cfg" retVal = cblobj.call50("EMPRW.ACU", PFUNCTION, PCOMPANYNUMBER, PEMPKEY1, PTRANSACTCODE, PDETAIL , PERROR ) '
Print "RETURN details => " Cstr(PDETAIL)

cblobj.Cancel ("EMPRW.ACU")
cblobj.Shutdown

End If


If PERROR = "35" Then
PERROR = "Successfull"
End If
Print "PERROR is =>"&PERROR
Exit Sub

errhndlr:
Print "There was an error with the automation object =>(" Error$ ")"
Resume Next

End Sub
Hi

Thanks for the reply

I have changed all the strings to variants, now it can run twice
before it refuses to create the object for the 3rd time

I have also noticed the script does not release the user session
after the .shutdown , any other Ideas would be appreciated

PS We are running on Acucobol 6.1.0

[Migrated content. Thread originally posted on 09 December 2004]

Hi,
I am trying to get an integration together with Lotus Notes
which supports Lotus Script (Very Similar to VB Script) Using the ACUGT Automation Controller - My Problem is the script Runs once
then refuses to run again until I reboot the server, Here is an example of the script.

Please anyone who can help will me much appreciaited

Sub Initialize
On Error Goto errhndlr

Dim PFUNCTION As String
Dim PCOMPANYNUMBER As String
Dim PEMPKEY1 As String
Dim PTRANSACTCODE As String
Dim PDETAIL As String
Dim PERROR As String
Dim cblobj As Variant
Dim retVal As Variant

Print "start"

PFUNCTION= "READ" PEMPKEY1 = "0002728M"
PTRANSACTCODE = "1251"
PCOMPANYNUMBER = "01"

Set cblobj = CreateObject("AcuGT.Application")
If cblobj Is Nothing Then
Print "error - no object created"
Else
Print "success - object created"
cblobj.Initialize "-c F:\\Payday\\payday.cfg" retVal = cblobj.call50("EMPRW.ACU", PFUNCTION, PCOMPANYNUMBER, PEMPKEY1, PTRANSACTCODE, PDETAIL , PERROR ) '
Print "RETURN details => " Cstr(PDETAIL)

cblobj.Cancel ("EMPRW.ACU")
cblobj.Shutdown

End If


If PERROR = "35" Then
PERROR = "Successfull"
End If
Print "PERROR is =>"&PERROR
Exit Sub

errhndlr:
Print "There was an error with the automation object =>(" Error$ ")"
Resume Next

End Sub
One thing that strikes me mind. From what I see of your code, it doesn't seem you destroy the object when you are set.
"Destroying" the object is important in the world of COM, because when you create an instance of COM, there is a counter in the object itself being incremented. To decrement this (which is important to release it), you have to "destroy" your connection. In Visual Basic this is done by setting the COM ptr to 0. If this is the same for Lotus Script, you should end your code with:

cblobj = 0.

This may however be different with Lotus Script. You ought to check this out.
Here is a Delphi code example:

MyAcu := TAcuGT.Create(self);
Str1 := '';
Str2 := 'f:\\source\\cbl510\\bin\\plugin.acu';
MyAcu.Initialize(Str1);
MyAcu.Call(Str2);
If Assigned(MyAcu) Then
  Begin
   MyAcu.Shutdown;
   MyAcu.Destroy;
   MyAcu := Nil;
  End;