In this recipe, you learn how to associate a running SAS workspace object with an ADO Connection object.
Applies to: | SAS IOM Data Provider |
Implement using: | ADO |
You can use the "SAS Workspace ID" property to associate a running SAS workspace object with an ADO Connection object. The following Visual Basic code fragment shows how this can be done:
obConnection.Provider = "sas.IOMProvider.1" obConnection.Properties("SAS Workspace ID") = obWS.UniqueIdentifier ' Set other connection properties... obConnection.Open
Note: For more information about how to open a Connection object, see Opening an ADO Connection Object.
"SAS Workspace ID" is a customized connection property. It indicates that you want to use a workspace that you have already created. You set this property on a Connection object after you set the Connection object's Provider property and before you invoke the Open method.
In the previous code fragment, obWS is a SAS.Workspace object. The workspace provides the same set of resources and facilities as an interactive or batch SAS session. The Workspace Object class is published by SAS as part of its Integration Technologies product.
Note: For information about working with object variables and creating a workspace, see the documentation for SAS Integration Technologies, which is located at which is located at support.sas.com/rnd/itech/library/library9.html. In the Developer's Guide under "Developing Windows Clients," see the section entitled "Programming with Visual Basic."
The UniqueIdentifier workspace property instructs the IOM provider to look up an existing workspace and to establish communication with it.