Usage Note 30795: Querying a SAS data set with the SASĀ® Local Data Provider for OLE DB
The SAS Local Data Provider for OLE DB does not support SQL, so any query that uses SQL syntax (for example, SELECT * FROM table-name) will fail.
The SAS Local Data Provider for OLE DB requires a 'Direct Table Open' in Visual Basic, such as the following:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Provider=SAS.localProvider;Data Source=C:\temp"
rs.Open "BTIMES", cn, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
Note that the first argument to the record set Open call must be the data set name (with no extension) and the last argument must be adCmdTableDirect (which ends up being the number 512).
The lock type (the third argument) must be adLockReadOnly, but the cursor type can be either adOpenDynamic (2) or adOpenForwardOnly (0).
Operating System and Release Information
| SAS System | SAS Providers for OLE DB | Windows Vista | | |
| Microsoft Windows XP Professional | | |
| Microsoft Windows Server 2003 Standard Edition | | |
| Microsoft Windows Server 2003 Enterprise Edition | | |
| Microsoft Windows Server 2003 Datacenter Edition | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Date Modified: | 2008-05-29 15:19:24 |
| Date Created: | 2007-12-17 14:35:20 |