Call SQL Server Stored Procedures with parameters,
We have a block of code that looks like this:
With ActiveSheet.QueryTables.Add(Connection:="ODBC;DSN= XXX",
Destination:=Range("A1"))
.CommandText = "spsReport17" ' Array("SELECT * FROM tblReport17")
.Name = "XXX"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
End With
..CommandText used to just be a 'SELECT * FROM...' statment but we are having
to change to Stored Procedures - and this worked ok.
However, we now need to pass a single parameter to this Stored Proc.
Can anybody tell me the syntax (or even if this is possible) please.
I've looked in the help and can't find anything about this.
|