Connecting to a Specific SAS/SHARE Server Version

Goal

You want your application to explicitly request access to a Version 7 or Version 8 SAS/SHARE server. By default, the SAS/SHARE provider uses the SAS 9 server access method.
This recipe applies to the SAS/SHARE provider. Sample code for ADO is included.

ADO Implementation

To specify a server version, you provide a value for the "SAS Server Release" property. You set the property on the Connection object because the connection is bound to a specific server.
Values for the "SAS Server Release" property are integer numbers that correspond to the version number of the server that is being accessed: 7, 8 (valid for both Version 7 and Version 8 servers), or 9 (the default).
The following Visual Basic code specifies the Version 7 SAS/SHARE server:
Dim obConnection As New ADODB.Connection

obConnection.Provider = "sas.ShareProvider"
obConnection.Properties("SAS Server Release") = 7
obConnection.Open

OLE DB Implementation

Use the DBPROP_SAS_SERVERRELEASE property to specify the access method. This property is a member of the DBPROPSET_SAS_DBINIT property set.