98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » Connect to SQL databases
Connect to SQL databases
Resolved · Medium Priority · Version 2010
Adrian has attended:
Excel VBA Introduction course
Connect to SQL databases
Hello,
I want to create a macro that call's a SQL database or stored procedure in a SQL database to copy in the information when I open the excel sheet, define a variable (for the query/stored procedure) and click a button to inititae the macro.
How do you call a stored procedure or run a query on a SQL database?
Thanks!
RE: Connect to SQL databases
Hi Adrian,
Thank you for the forum question.
And thank you for the nice feedback.
The best way as I told you is to use ADO to create a connection via a provider. You can connect to a query already created in the SQL database or you can write a SQL query in the visual basic editor and then execute the query from Excel.
SQL is very powerful and you are totally in control using SQL to tell Excel which data you want to display in your Excel reports.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Hiding Formulae in the Formula BarIt is possible to protect the contents of a cell reference(s) from amendment by applying cell protection. The contents of the cell reference can also be stopped from displaying in the formula bar. |