Dim obObjectFactory As New SASObjectManager.ObjectFactoryMulti2 Dim obSAS As SAS.Workspace Dim obServer As New SASObjectManager.ServerDef obServer.MachineDNSName = "RemoteMachine.company.com" obServer.Protocol = ProtocolBridge obServer.Port = 6903 Set obSAS = obObjectFactory.CreateObjectByServer("myName", True, obServer, "myUserName", "myPassword")
Dim obObjectFactory As New SASObjectManager.ObjectFactoryMulti2 Dim obObjectKeeper As New SASObjectManager.ObjectKeeper Dim obSAS As SAS.Workspace Dim obSAS2 As SAS.Workspace Dim obServer As New SASObjectManager.ServerDef Dim obServer2 As New SASObjectManager.ServerDef obServer.MachineDNSName = "MachineA.company.com" obServer.Protocol = ProtocolBridge obServer.Port = 6903 obObjectFactory.CreateObjectByServer "myName", False, obServer, "myUsername", "myPassword" obServer2.MachineDNSName = "MachineB.company.com" obServer2.Protocol = ProtocolBridge obServer2.Port = 6903 obObjectFactory.CreateObjectByServer "myName2", False, obServer2, "myUsername", "myPassword" ' Note that the first parameter here matches the first parameter in the ' call to CreateObjectByServer Set obSAS = obObjectKeeper.WaitForObject("myName", 10000) Set obSAS2 = obObjectKeeper.WaitForObject("myName2", 10000)
Public WithEvents obObjectKeeperEvents As SASObjectManager.ObjectKeeper Private Sub Form_Load() Dim obObjectFactory As New SASObjectManager.ObjectFactoryMulti2 Dim obObjectKeeper As New SASObjectManager.ObjectKeeper Dim obSAS As SAS.Workspace Dim obSAS2 As SAS.Workspace Dim obServer As New SASObjectManager.ServerDef Dim obServer2 As New SASObjectManager.ServerDef Set obObjectKeeperEvents = obObjectKeeper obServer.MachineDNSName = "MachineA.company.com" obServer.Protocol = ProtocolBridge obServer.Port = 6903 obObjectFactory.CreateObjectByServer "myName", False, obServer, "myUsername", "myPassword" obServer2.MachineDNSName = "Machineb.company.com" obServer2.Protocol = ProtocolBridge obServer2.Port = 6903 obObjectFactory.CreateObjectByServer "myName2", False, obServer2, "myUsername", "myPassword" End Sub Private Sub obObjectKeeperEvents_ErrorAdded(ByVal objectName As String, ByVal errInfo As String) Debug.Print "Error creating " & objectName & ": " & errInfo End Sub Private Sub obObjectKeeperEvents_ObjectAdded(ByVal objectName As String, ByVal objectUUID As String) Debug.Print "Added object " & objectName & ": " & objectUUID Dim obSAS As SAS.Workspace Set obSAS = obObjectKeeperEvents.GetObjectByUUID(objectUUID) Debug.Print obSAS.UniqueIdentifier End Sub
Dim obObjectFactory As New SASObjectManager.ObjectFactoryMulti2 Dim obSAS As SAS.Workspace ' This assumes that your metadata configuration files are in the default ' location, or that the location of your configuration files is stored ' in the registry. If this is not the case, or you want each application ' on a given machine to use its own metadata repository, then you should ' call ' obObjectFactory.SetMetadataFile systemFile, userFile, false Set obSAS = obObjectFactory.CreateObjectByLogicalName("myName", True, "LogicalName", "LoginReference")