question

ranjanrkl avatar image
ranjanrkl asked

VBA Code that connects Database and execute a stored procedure through a click of button in excel 2013.

i am new to VBA,can anyone please help me with this to write a VBA code that Connect Sql Sever Database and execute a stored procedure through a click of button in excel 2013. Details below: Server name - LE64-08\SQL2012 Database Name- MDS Authentication Type - Windows Authentication Stored Procedure Name - LoadSP any help would be really appreciated.
stored-proceduresexcelvbscript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Fatherjack avatar image
Fatherjack answered
You will need to investigate SQL Server SMO, looking for Server and database connections along with how to execute a query on MSDN. Most MSDN examples have VB versions so the conversion to VBA should be pretty simple - take a look at this page for a starter: http://msdn.microsoft.com/en-us/library/ms205775.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.