HNA071252
asked on
SQL Server - Execute SQL Server store procedure from Excel
Hi,
Could you please let me know why my code below isn't working?
Set cmd = New ADODB.Command
cmd.ActiveConnection = Cn
cmd.CommandText = "Exec TRP.M_Par_update_process"
'cmd.CommandTimeout = 1200 ' 20 minutes
cmd.CommandType = adCmdStoredProc
cmd.Execute , , adAsyncExecute
MsgBox ("Loaded & Processed!")
When a button in Excel is clicked, I want it to execute a store procedure name "TRP.M_Par_update_process" in the SQL Server without having to wait in Excel until the procedure is completely done.
Could you please let me know why my code below isn't working?
Set cmd = New ADODB.Command
cmd.ActiveConnection = Cn
cmd.CommandText = "Exec TRP.M_Par_update_process"
'cmd.CommandTimeout = 1200 ' 20 minutes
cmd.CommandType = adCmdStoredProc
cmd.Execute , , adAsyncExecute
MsgBox ("Loaded & Processed!")
When a button in Excel is clicked, I want it to execute a store procedure name "TRP.M_Par_update_process"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi all
I know this question has already been answered, but if it helps I finished an article on how to build an Excel front-end, SQL Server Stored Procedure back-end that allows users to enter cell-based parameters:
Microsoft Excel & SQL Server: Self service BI to give users the data they want
If you like what you see, please click the 'Yes' button next to 'Was this article helpful?', and provide some feedback.
Thanks in advance.
Jim
I know this question has already been answered, but if it helps I finished an article on how to build an Excel front-end, SQL Server Stored Procedure back-end that allows users to enter cell-based parameters:
Microsoft Excel & SQL Server: Self service BI to give users the data they want
If you like what you see, please click the 'Yes' button next to 'Was this article helpful?', and provide some feedback.
Thanks in advance.
Jim
ASKER