I am trying to run SQL Server Store Procedure from Excel. I have the following code which ran with no error in Excel but did not seem to do anything in SQL Server. What could be wrong.
Also how can I check the the connection is setup correctly and working? Thanks
Sub Bld_Eol_Bom_Data()
End Sub
Also how can I check the the connection is setup correctly and working? Thanks
Sub Bld_Eol_Bom_Data()
Dim sqlStatement As String
sqlStatement = "EXECUTE dbo.bld_eol_bom ;"
Debug.Print sqlStatement
With ActiveWorkbook.Connections("hhi-t-sql05-eSearch").OLEDBConnection.CommandText = sqlStatement
End With
ActiveWorkbook.Connections("hhi-t-sql05-eSearch").Refresh
sqlStatement = "EXECUTE dbo.bld_eol_bom ;"
Debug.Print sqlStatement
With ActiveWorkbook.Connections("hhi-t-sql05-eSearch").OLEDBConnection.CommandText = sqlStatement
End With
ActiveWorkbook.Connections("hhi-t-sql05-eSearch").Refresh
End Sub