Hi -
I am trying to connect SAS from VBA and fetch the data to excel spread sheet. Below is the code what I am trying.
Public Sub GetData()
Dim obConnection As ADODB.Connection Dim obRecordset As ADODB.Recordset Dim i As Integer Set obConnection = New ADODB.Connection obConnection.Provider = "sas.LocalProvider.1" obConnection.Properties("Data Source") = "sas.abc.abc.com:1234" obConnection.ConnectionString = "Provider=SAS.IOMProvider; Data Source=iom-bridge://sas.abc.abc.com:1234; User ID=abcd;Password=1234" Set obRecordset = New ADODB.Recordset obRecordset.Open "proc sql; select * from aa.getdata_dim; QUIt;", obConnection, adOpenStatic, adLockPessimistic, End Sub
When my code try to open the recordset. Code fails and I am prompted with run time error as below.
--------------------------- Microsoft Visual Basic for Applications --------------------------- Run-time error '3709':
Application-defined or object-defined error --------------------------- OK Help ---------------------------
Has any one achieved this, and help me out ?
Cheers
VS
... View more