Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
Public Sub TotalPrivateDaysFromRtoA() Dim cnn As Object Dim CRecordset3 As Object ' Create a connection object Set cnn = CreateObject("ADODB.Connection") ' Connect to the database cnn.Provider = "SQLOLEDB" cnn.Open "Server=vaio;Database=Product;User Id=admin;Password=asd345po" If cnn.State <> 1 Then MsgBox "Could not connect to the database" Exit Sub End If ' Open recordset BeginNextRecordset Set CRecordset3 = CreateObject("ADODB.Recordset") CRecordset3.Open "EXEC sp_TotalPriceperMoth", cnn, adOpenDynamic, adLockPessimistic Sheets("Sheet1").[B4].CopyFromRecordset CRecordset3 cnn.Close Set cnn = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.