Language Service Submit: Error '91'

I executed the solution posted in the link below to make a simple SAS request via VBA: SAS call through VBA

Dim obObjectFactory As New SASObjectManager.ObjectFactory
Dim obObjectKeeper As New SASObjectManager.ObjectKeeper
Dim obServer As New SASObjectManager.ServerDef
Dim obSAS As SAS.Workspace
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
obServer.MachineDNSName = "xxxx@company.com"
obServer.Protocol = ProtocolBridge
obServer.Port = 8561
obObjectFactory.LogEnabled = True
Set obSAS = obObjectFactory.CreateObjectByServer("sas", False, obServer, "", "")
obSAS.LanguageService.Submit "PROC SQL; CREATE TABLE ME.TABLE1; RUN;" 'Error at submit

But I get the error in the above send line as "Object variable or with non-blocking variable"

+4
source share
1 answer

You are trying to create an asynchronous connection. Instead, I would try to create a synchronous connection (change the second parameter to true).

Set obSAS = obObjectFactory.CreateObjectByServer("sas", True, obServer, "", "")

, . . TRUE, CreateObjectByServer , . FALSE, . , ObjectKeeper.

SAS. , Nothing .

http://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/winclnt/omcreate.html

Submit ,

If obSAS Is Nothing Then
   MsgBox("Connection failed")
Else
   obSAS.LanguageService.Submit "PROC SQL; CREATE TABLE ME.TABLE1; RUN;" 'Error at submit
End If

, Object Object .

'-2147213310 (80042002) /. SAP, . html. , / .

8591. , . , , , "", .

BTW: IWA ( Windows), ().

Set obSAS = obObjectFactory.CreateObjectByServer("sas", True, obServer, Nothing, Nothing)
0

Source: https://habr.com/ru/post/1695723/


All Articles